Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QG][KIM] Application that generates loads by creating or deleting Runtime CR #421

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mvshao
Copy link
Contributor

@mvshao mvshao commented Oct 17, 2024

Description
The program is used to generate performance test loads by creating or deleting Runtime CR in a given Kubernetes cluster.

Changes proposed in this pull request:

  • created an application that generates test Runtime CR in amount provided by the user
  • supports local testing and CI/CD environment

Related issue(s)
#14

@mvshao mvshao requested review from a team as code owners October 17, 2024 08:39
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 17, 2024
@kyma-bot kyma-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 17, 2024
Copy link
Contributor

@koala7659 koala7659 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comments

switch os.Args[1] {
case "create":
createCmd.Parse(os.Args[2:])
if *loadID == "" || *namePrefix == "" || *kubeconfig == "" || *rtNumber == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag templatePath is also required and should be also checked here

kubeconfig := createCmd.String("kubeconfig", "", "the path to the kubeconfig file (required)")
rtNumber := createCmd.Int("rt-number", 0, "the number of the runtimes to be created (required)")
templatePath := createCmd.String("rt-template", "", "the path to the yaml file with the runtime template (required)")
runOnCi := createCmd.String("run-on-ci", "false", "identifies if the load is running on CI")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to change type of this flag to Bool if possible - this will avoid problem in line 70 if a user provides anything different than "false"

return Unknown, nil, err
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a user provides anything different than "false" ex "FALSE" or "aaaaa" the code under if statement will not be executed.
I suggest:

  1. use flag.Bool type for this parameter runOnCi
  2. Change this code into:
    if *runOnCi == false {
    }

}

func readFromSource(reader io.Reader) (imv1.Runtime, error) {
data, err := io.ReadAll(reader)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error value is not handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants