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

policy server use kubernetes recommended labels #1037

Conversation

flavio
Copy link
Member

@flavio flavio commented Mar 6, 2025

All the resources associated with Policy Server are now using the labels recommended by Kubernetes, see here.

All the resources associated with Policy Server are now using the
labels recommended by Kubernetes, see here:
https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels

Signed-off-by: Flavio Castelli <[email protected]>
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.62%. Comparing base (8843568) to head (e755c1f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1037      +/-   ##
==========================================
+ Coverage   72.47%   72.62%   +0.15%     
==========================================
  Files          30       30              
  Lines        3760     3781      +21     
==========================================
+ Hits         2725     2746      +21     
  Misses        877      877              
  Partials      158      158              
Flag Coverage Δ
integration-tests 58.57% <100.00%> (+0.23%) ⬆️
unit-tests 58.63% <0.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@flavio flavio force-pushed the policy-server-use-kubernetes-recommended-labels branch from e755c1f to 0f18201 Compare March 7, 2025 09:21
@flavio flavio marked this pull request as ready for review March 7, 2025 09:22
@flavio flavio requested a review from a team as a code owner March 7, 2025 09:22
@flavio flavio added this to the 1.23 milestone Mar 7, 2025
Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM

@jvanz jvanz mentioned this pull request Mar 7, 2025
4 tasks
Comment on lines +91 to +93
for k, v := range policyServer.CommonLabels() {
Expect(deployment.Spec.Template.ObjectMeta.Labels).To(HaveKeyWithValue(k, v))
}
Copy link
Member Author

Choose a reason for hiding this comment

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

folks, I'm not a ginkgo expert. I didn't find a better way to write this assertion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is a better way to do this since gomega Keys is used to match literal keys.

However, once we remove the legacy labels, we could be strict in this assertion:

Expect(deployment.Spec.Template.ObjectMeta.Labels).To(Equal(policyServer.CommonLabels()))

Comment on lines +91 to +93
for k, v := range policyServer.CommonLabels() {
Expect(deployment.Spec.Template.ObjectMeta.Labels).To(HaveKeyWithValue(k, v))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is a better way to do this since gomega Keys is used to match literal keys.

However, once we remove the legacy labels, we could be strict in this assertion:

Expect(deployment.Spec.Template.ObjectMeta.Labels).To(Equal(policyServer.CommonLabels()))

@flavio flavio merged commit 7a06d20 into kubewarden:main Mar 7, 2025
11 checks passed
@flavio flavio deleted the policy-server-use-kubernetes-recommended-labels branch March 7, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants