-
Notifications
You must be signed in to change notification settings - Fork 589
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
Cleanup multus conf on exit #1299
Cleanup multus conf on exit #1299
Conversation
This is a proposed alternative to : #1298 as we used to clean up multus conf file in preStop hook, however since the container no longer has shell we cannot run simple sh commands for cleanup. |
4198a76
to
273c175
Compare
1b45d8f
to
ecc67c7
Compare
Let's add some notes about the flags @ https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/how-to-use.md#entrypoint-script-parameters |
this provides a simple way to handle incoming os signas using context Signed-off-by: adrianc <[email protected]>
- if cleanup-config-on-exit is set delete generated multus config file on exit. - add an option to skip watch for master cni config and kubeconfig as cleanup-config-on-exit with multus-conf-file=auto also triggered the watch for cases when deletion of multus config is desired but watch isnt - setup signal handling to allow config file cleanup on exit Signed-off-by: adrianc <[email protected]>
ecc67c7
to
7408fdf
Compare
7408fdf
to
1bbc166
Compare
@dougbtv docs update. additional feedback/review appreciated :) |
Signed-off-by: adrianc <[email protected]>
1bbc166
to
6ade0ce
Compare
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.
Appreciate the updates for the docs!
@dougbtv @adrianchiris ty for landing this. is disabling the watch functionality necessary if CleanupConfigOnExit=true and MultusConfFile=auto because the file may be recreated before we're able to completely exit? does the cleanupMultusConf being in the defer block not ensure this? I'm not seeing how the file could be recreated after this is called. if I'm understanding correctly, CleanupConfigOnExit and the watch functionality are basically incompatible. happy to attempt improving this once I clarify my understanding. |
@seastco there is a select statement on signal handler context. cleanup config on exit should work both if watching or not. the "skip-config-watch" flag was added to preserve backward compatibility since cleanup config on exit originally triggered the watch for some reason (imo it shouldnt and is counter intuitive). |
if cleanup-config-on-exit is set delete generated multus
config file on exit.
add an option to skip watch for master cni config and kubeconfig
as cleanup-config-on-exit with multus-conf-file=auto also triggered
the watch for cases when deletion of multus config is desired but watch isnt
setup signal handling to allow config file cleanup on exit