Prevent Service Account annotation conflicts on OpenShift 4.16 #10314
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.
Type of change
Description
It looks like we have on OCP 4.16 a conflict in the reconciliation of Service Accounts.
OpenShift 4.16 will create an image pull secret, add it to the image pull secrets list, and attach an annotation
openshift.io/internal-registry-pull-secret-ref
to the Service Account with the name of the image pull secret. If Strimzi removes this annotation by patching the resource in the next reconciliation, OpenShift will create another Secret, add it to the image pull secret list and add back the annotation. This way, every reconciliation will for every Service Account make OCP generate a new Secret and in a little while, the namespace is full of these Secrets.This PR recovers the annotation from the original resource when patching it and reads it to the desired Service Account to avoid removing the annotation and triggering OCP to create a new Secret. This is not a great solution, but until we have Server Side Apply support, this is the best we can do.
Checklist