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

MutatingWebhookConfiguration update issues #78

Open
xujinheng opened this issue Aug 27, 2022 · 1 comment
Open

MutatingWebhookConfiguration update issues #78

xujinheng opened this issue Aug 27, 2022 · 1 comment
Labels
enhancement New feature or request needs-triage

Comments

@xujinheng
Copy link

xujinheng commented Aug 27, 2022

What would you like to be added:

  1. Currently, the MutatingWebhookConfiguration is created by init-containers, which means if we want to update existing MutatingWebhookConfiguration, we have to do
kubectl delete -f install.yaml && kubectl create -f install.yaml

to let init-containers works again and check if existing MutatingWebhookConfiguration needs updating. If there a better way to do this? By Kubernetes operators?

  1. The compare_mwc_fields function in imageswap-init.py only checks keys in new MutatingWebhookConfiguration now.
for key in sorted(new):

Which means if newer MutatingWebhookConfiguration has less key then the existing one, init-containers will assert them to be same, which is actually not.

Why is this needed:

To avoid MutatingWebhookConfiguration updating failures

@xujinheng xujinheng added the enhancement New feature or request label Aug 27, 2022
@phenixblue
Copy link
Owner

You should be able to do something like this:

$ kubectl rollout restart deploy -n image swap-system imageswap

When the pods recycle, the init-container should run again.

The current state of image swap doesn't yield for a controller/operator pattern, but that may be an option once the project is ported to Golang.

I think I can add in a check to compare the len(new) and len(existing) to take care of the scenario you mentioned.

Let me know if that answers your questions/concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants