-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Validate the type of configmap before loading parameters. Fixes #7312 #7314
Conversation
…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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change
workflow/common/configmap.go
Outdated
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ConfigMap '%s' needs to have the label %s: %s for parameters loading", | |
"ConfigMap '%s' needs to have the label %s: %s to load parameters", |
There was a problem hiding this comment.
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>
Fixes #7312.
Signed-off-by: Yuan Tang terrytangyuan@gmail.com
Don't bother creating a PR until you've done this:
make pre-commit -B
to fix codegen, lint, and commit message problems.Create your PR as a draft.
does not need to pass.
Tips: