-
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
Init container not removed when cronjob is updated #52177
Comments
@julia-stripe
Note: Method 1 will trigger an email to the group. You can find the group list here and label list here. |
/sig apps |
Do you see the alpha/beta initcontainer annotations on the API object? If so, unless you also change the annotations, changes to the API field will be ignored (see discussion in #47264 (comment) for how we ended up with that behavior) To remove initcontainers from the cronjob with apply, I think you would need to explicitly null out the initcontainer annotations in your applied object. |
thanks so much, that workaround works! |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
I created a cronjob with an init container. This works correctly. I then updated that cronjob (with
kubectl apply
) to no longer have an init container. This doesn't work -- after updating the cronjob, the init container is still there. (also, there are no error messages)Strangely, updating the init container works correctly, but removing the init container does not work.
(I'm planning to work on fixing this, but wanted to report an issue first in case anyone has any thoughts)
What you expected to happen:
I expected the init container to be removed.
How to reproduce it (as minimally and precisely as possible):
I created a gist with a script that reproduces this issue at https://gist.github.com/julia-stripe/8b9ad694c9f0208828493f012582c863. Here's how to run the script:
Here's the relevant output:
Anything else we need to know?:
a few more notes:
pod.beta.kubernetes.io/init-containers
annotations, but deleting them still doesn'tI noticed that modifying or deleting the init container on a Job also doesn't work (see this output) for what happens.
I'd expect modifying/deleting the init containers on a Job object to give a validation error, but instead it just silently fails. Overall everything related to changing init containers on jobs / cronjobs seems to not work well.
Environment:
The text was updated successfully, but these errors were encountered: