-
Notifications
You must be signed in to change notification settings - Fork 172
Add '--force' flag when switching from 'Ignore' to 'Propagate' mode #1169
Conversation
/assign @adrianludwin |
/assign @yiqigao217 Yiqi, can you please work with Ginny to fine-tune the error message? We should explain exactly why this feature exists, and maybe link to some documentation as well (which we might need to write). |
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.
Basic code lgtm! We need to tweak the message, please work on this with Yiqi.
0caaa84
to
71e6970
Compare
fmt.Println("If you are sure you want to proceed with this operation, use the '--force' flag.") | ||
fmt.Println("If you are not sure and would like to see what source objects would be overwritten," + | ||
"please switch to 'Remove' first. Wait 10s before switching it to 'Propagate', which will" + | ||
" list all the conflicts that you can resolve them by hand.") |
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.
I'd add a link to https://github.com/kubernetes-sigs/multi-tenancy/blob/master/incubator/hnc/docs/user-guide/how-to.md#admin-types, and file a bug to update that topic to discuss this issue.
Also, I'm not sure that 10s is enough? In the doc you can go into more detail; maybe here I'd either say "a minute or two" or just say "to see how to enable propagation safely, see <link>."
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.
Done. Issue filed at #1172
/retest |
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.
lgtm after one last nit on the message, but I'll send this to Ryan now.
/lgtm
/approve
/hold
/assign @rjbez17
If the user switch the propagation mode directly from 'Ignore' to 'Propagate', it will fail with an error message telling the user that a '--force' flag is needed. '-f' is also supported as a shorthand. Tested: make test-e2e
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianludwin, GinnyJI The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Sorry missed this PR earlier. BTW seems we still need e2e tests on switching modes between others, e.g. allow Remove => Propagate, etc.
I don't think we need exhaustive testing, it doesn't have to be 100% black-box given how simple the feature is. |
/lgtm |
If the user switch the propagation mode directly from 'Ignore' to
'Propagate', it will fail with an error message telling the user that a
'--force' flag is needed. '-f' is also supported as a shorthand.
Tested: make test-e2e