-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Make sure --record=false is acknowledged when passed to commands #28234
Make sure --record=false is acknowledged when passed to commands #28234
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
4 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
cc @kubernetes/kubectl |
ok to test |
@@ -491,7 +491,7 @@ func ContainsChangeCause(info *resource.Info) bool { | |||
|
|||
// ShouldRecord checks if we should record current change cause | |||
func ShouldRecord(cmd *cobra.Command, info *resource.Info) bool { | |||
return GetRecordFlag(cmd) || ContainsChangeCause(info) | |||
return GetRecordFlag(cmd) || (ContainsChangeCause(info) && !cmd.Flags().Changed("record")) |
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.
Please update the flag documentation to be more clear. Also please add a test for this.
@k8s-bot node e2e test this please, issue #IGNORE |
193d13c
to
8f4b911
Compare
ok to test |
@pwittrock bump, is there anything else you need me to do with this? thanks |
5c9916b
to
391f4c9
Compare
@damemi Sorry I was OOO for the past 2 weeks. Would you update the documentation for the
This doesn't accurately cover the flag values. Maybe:
|
391f4c9
to
146a3c4
Compare
@pwittrock that's fine, updated! |
|
||
### Do not record label change | ||
# Command | ||
kubectl label pods valid-pod no-record-change=true "${kube_flags[@]}" --record=false |
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.
nit: would you make sure the flags are given in a consistent order to make it easier to read?
# Post-condition: valid-pod's record annotation still contains command with --record=true | ||
kube::test::get_object_assert 'pod valid-pod' "{{range$annotations_field}}{{.}}:{{end}}" ".*--record=true.*" | ||
|
||
|
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.
nit: Delete the extra new lines
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.
Please also add a test that the record is written if the flag is unspecified and the object has a previous record
@damemi Thanks. Just a couple comments on the test. Almost there. |
146a3c4
to
a616266
Compare
a616266
to
cfbf7da
Compare
GCE e2e build/test passed for commit cfbf7da. |
@damemi Thanks |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit cfbf7da. |
Automatic merge from submit-queue |
Ensures that when
--record=false
is explicity set that noChangeCauseAnnotation
s are set on the object. Previously, if--record=true
was used then all following actions triggered aChangeCauseAnnotation
even if--record=false
was set, due to the priorChangeCauseAnnotation
existing.Reference to bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1351127