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

Fix: PSS label reset issue #821

Conversation

varshab1210
Copy link
Member

What type of PR is this?

/kind bug

What does this PR do / why we need it:
Previously, PSS labels in openshift-gitops ns did not get reconciled and reset upon modification to the values. This PR fixes the issue

Have you updated the necessary documentation?

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

Which issue(s) this PR fixes:
https://issues.redhat.com/browse/GITOPS-5945

Fixes #?

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

Copy link

openshift-ci bot commented Dec 23, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@varshab1210 varshab1210 marked this pull request as ready for review December 24, 2024 04:53
Copy link
Member

@svghadi svghadi left a comment

Choose a reason for hiding this comment

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

Thanks @varshab1210. I have left a suggestion in watch logic. PTAL. It would also be great to have some unit tests for this. Maybe a test to verify that labels are added to the namespace and correctly reconciled when modified. You can use below tests for reference.

controllers/gitopsservice_controller.go Outdated Show resolved Hide resolved
@varshab1210 varshab1210 force-pushed the fix-enforce-version-label-reset branch from afef117 to b000341 Compare January 13, 2025 11:15
@varshab1210
Copy link
Member Author

/retest

1 similar comment
@varshab1210
Copy link
Member Author

/retest

@varshab1210
Copy link
Member Author

/test v4.12-kuttl-parallel

Comment on lines +110 to +116
Watches(
&corev1.Namespace{},
&handler.EnqueueRequestForObject{},
builder.WithPredicates(predicate.NewPredicateFuncs(func(obj client.Object) bool {
return obj.GetName() == "openshift-gitops"
})),
).
Copy link
Member

@svghadi svghadi Jan 16, 2025

Choose a reason for hiding this comment

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

Note to self: Use selectors at cache level to optimize memory consumption.

@svghadi
Copy link
Member

svghadi commented Jan 16, 2025

/lgtm

@varshab1210 varshab1210 force-pushed the fix-enforce-version-label-reset branch from 341bec4 to c269db4 Compare January 16, 2025 05:57
@openshift-ci openshift-ci bot removed the lgtm label Jan 16, 2025
Copy link
Member

@svghadi svghadi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@varshab1210
Copy link
Member Author

/retest

@iam-veeramalla
Copy link
Collaborator

/lgtm
/approve

Copy link

openshift-ci bot commented Jan 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iam-veeramalla, svghadi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [iam-veeramalla,svghadi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@varshab1210
Copy link
Member Author

/retest

@varshab1210
Copy link
Member Author

/test v4.17-e2e

@svghadi
Copy link
Member

svghadi commented Jan 16, 2025

/retest

1 similar comment
@svghadi
Copy link
Member

svghadi commented Jan 16, 2025

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit f652316 into redhat-developer:master Jan 16, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved kind/bug Something isn't working lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants