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

✨ Add ValidatingAdmissionPolicy to enforce package uniqueness across ClusterExtension #774

Merged

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Apr 22, 2024

Description

To enforce package uniqueness across ClusterExtension.

We currently have this enforcement on the operator-controller level, but with Deppy removal in #758 we want to shift it into API server.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2024
Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit e59ab41
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/6627c31efc68150007eb44af
😎 Deploy Preview https://deploy-preview-774--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.16%. Comparing base (0c41e3e) to head (e59ab41).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #774   +/-   ##
=======================================
  Coverage   67.16%   67.16%           
=======================================
  Files          22       22           
  Lines        1465     1465           
=======================================
  Hits          984      984           
  Misses        415      415           
  Partials       66       66           
Flag Coverage Δ
e2e 45.46% <ø> (ø)
unit 61.34% <ø> (ø)

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.

@m1kola m1kola force-pushed the add_ValidatingAdmissionPolicy branch from f17ff5e to 55eab3e Compare April 22, 2024 14:58
@m1kola
Copy link
Member Author

m1kola commented Apr 22, 2024

Keeping this in draft for now. It seems like tilt job needs to be updated in addition to #771

@m1kola m1kola force-pushed the add_ValidatingAdmissionPolicy branch 3 times, most recently from 5d45189 to 6537533 Compare April 23, 2024 10:23
@m1kola m1kola force-pushed the add_ValidatingAdmissionPolicy branch 2 times, most recently from 0951051 to 4cadf14 Compare April 23, 2024 12:45
To enforce package uniqueness across `ClusterExtension`

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
This is a workaround for kustomize issue where it does not prefix
`ValidatingAdmissionPolicy`'s name in `ValidatingAdmissionPolicyBinding`'s
field `spec.policyName`. This results in manifests which can still be
applied to a cluster, but the policy will not be working due to
broken policy binding.

These APIs are now stable in 1.30 so one might expect that Kustomize
will eventually support these by default. If this happens - we will
be able to remove this change.

Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@m1kola m1kola force-pushed the add_ValidatingAdmissionPolicy branch from 4cadf14 to e59ab41 Compare April 23, 2024 14:18
@m1kola m1kola marked this pull request as ready for review April 23, 2024 14:27
@m1kola m1kola requested a review from a team as a code owner April 23, 2024 14:27
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 23, 2024
@m1kola m1kola requested a review from joelanford April 23, 2024 14:28
@m1kola m1kola mentioned this pull request Apr 23, 2024
4 tasks
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Looks great!

In a follow-up, could we add some tests?

@grokspawn grokspawn added this pull request to the merge queue Apr 24, 2024
Merged via the queue into operator-framework:main with commit 189b42a Apr 24, 2024
19 checks passed
@m1kola m1kola deleted the add_ValidatingAdmissionPolicy branch April 25, 2024 08:20
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.

None yet

3 participants