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

[release-0.13] fix: update logic to preserve k8s specific labels & annotations (#1616) #1617

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

svghadi
Copy link
Collaborator

@svghadi svghadi commented Dec 5, 2024

cherry-pick #1616

What does this PR do / why we need it:

Operator overwrites k8s added labels or annotations. This sometimes results into unexpected behaviour. Eg. A kubectl rollout restart on deployment adds an annotation "kubectl.kubernetes.io/restartedAt" with timestamp. However operator detects this as a config drift and removes the annotations resulting into k8s terminating the rollout due to change in config. This commit fixes the issue by preserving such annotations & labels added onto live object during comparison.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?

How to test changes / Special notes to the reviewer:

…proj-labs#1616)

* Fix update logic to preserve k8s specific labels & annotations

Operator overwrites k8s added labels or annotations. This sometimes
results into unexpected behaviour. Eg. A kubectl rollout restart on deployment
adds an annotation "kubectl.kubernetes.io/restartedAt" with timestamp.
However operator detects this as a config drift and removes the annotations
resulting into k8s terminating the rollout due to change in config. This commit
fixes the issue by preserving such annotations & labels added onto live object
during comparison.

Signed-off-by: Siddhesh Ghadi <[email protected]>
@svghadi svghadi changed the title fix: update logic to preserve k8s specific labels & annotations (#1616) [release-0.13] fix: update logic to preserve k8s specific labels & annotations (#1616) Dec 5, 2024
Signed-off-by: Siddhesh Ghadi <[email protected]>
Copy link
Collaborator

@anandf anandf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@svghadi
Copy link
Collaborator Author

svghadi commented Dec 5, 2024

--- FAIL: kuttl/harness/1-036_validate_role_rolebinding_for_source_namespace (64.31s)

Above test a known flaky failure. Will ignore and the merge the PR.

@svghadi svghadi merged commit 66a5032 into argoproj-labs:release-0.13 Dec 5, 2024
4 of 5 checks passed
@svghadi svghadi deleted the cherry-pick-reg branch December 5, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants