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

fix: Validate the type of configmap before loading parameters. Fixes #7312 #7314

Merged
merged 4 commits into from
Dec 1, 2021
Merged

fix: Validate the type of configmap before loading parameters. Fixes #7312 #7314

merged 4 commits into from
Dec 1, 2021

Conversation

terrytangyuan
Copy link
Member

@terrytangyuan terrytangyuan commented Dec 1, 2021

Fixes #7312.

Signed-off-by: Yuan Tang terrytangyuan@gmail.com

Don't bother creating a PR until you've done this:

  • Run make pre-commit -B to fix codegen, lint, and commit message problems.

Create your PR as a draft.

  • Your PR needs to pass the required checks before it can be approved. If the check is not required (e.g. E2E tests) it
    does not need to pass.
  • Once required tests have passed, you can make it "Ready for review".
  • Say how how you tested your changes. If you changed the UI, attach screenshots.

Tips:

  • If changes were requested, and you've made them, then dismiss the review to get it looked at again.
  • Add you organization to USERS.md if you like.
  • You can ask for help!

…7312

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
@@ -1,4 +1,4 @@
package util
package common
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this file to common to avoid cyclic dependencies

@terrytangyuan terrytangyuan requested a review from alexec December 1, 2021 03:39
Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

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

Minor change

@@ -18,6 +18,11 @@ func GetConfigMapValue(configMapInformer cache.SharedIndexInformer, namespace, n
if !ok {
return "", fmt.Errorf("unable to convert object %s to configmap when syncing ConfigMaps", name)
}
if cmType := cm.Labels[LabelKeyConfigMapType]; cmType != LabelValueTypeConfigMapParameter {
return "", fmt.Errorf(
"ConfigMap '%s' needs to have the label %s: %s for parameters loading",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"ConfigMap '%s' needs to have the label %s: %s for parameters loading",
"ConfigMap '%s' needs to have the label %s: %s to load parameters",

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
@terrytangyuan terrytangyuan enabled auto-merge (squash) December 1, 2021 15:50
@terrytangyuan terrytangyuan merged commit cf78ff6 into argoproj:master Dec 1, 2021
@terrytangyuan terrytangyuan deleted the use-label-cm-parameter branch December 1, 2021 16:08
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this pull request Dec 15, 2021
…7312 (#7314)

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LabelValueTypeConfigMapParameter is unused, why?
2 participants