Improve the check for Pod spec changes #2378
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In the current implementation we could hit issues if someone changes the pods outside the operator control, e.g. by manually changing the pod spec with
kubectl edit ..
. The risk is fairly minimal since the pod spec has a limited set of fields that can be changed, but in general the operator should validate those fields, e.g. in case someone changes the image of a running pod.Type of change
Discussion
I discussed this offline and we probably want to add a new annotation to the operator which can be set on a per pod level to ignore pod changes. This could be useful in debugging cases where a user wants to keep the pod running, but wants to pull a container with additional debugging tooling. I create a GitHub issue for this before merging.
Testing
Added additional unit and e2e tests.
Documentation
Follow-up