Skip to content

✨ Add ValidatingAdmissionPolicy to enforce package uniqueness across ClusterExtension - #774

Merged
grokspawn merged 2 commits into
operator-framework:mainfrom
m1kola:add_ValidatingAdmissionPolicy
Apr 24, 2024
Merged

✨ Add ValidatingAdmissionPolicy to enforce package uniqueness across ClusterExtension#774
grokspawn merged 2 commits into
operator-framework:mainfrom
m1kola:add_ValidatingAdmissionPolicy

Conversation

@m1kola

@m1kolam1kola commented Apr 22, 2024

Copy link
Copy Markdown
Member

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-ciopenshift-ciBot 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
@netlify

netlifyBot commented Apr 22, 2024

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commite59ab41
🔍 Latest deploy loghttps://app.netlify.com/sites/olmv1/deploys/6627c31efc68150007eb44af
😎 Deploy Previewhttps://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.

Comment threadconfig/admission/admission.yaml Outdated
@codecov

codecovBot commented Apr 22, 2024

Copy link
Copy Markdown

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 
FlagCoverage Δ
e2e45.46% <ø> (ø)
unit61.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
m1kolaforce-pushed the add_ValidatingAdmissionPolicy branch from f17ff5e to 55eab3eCompareApril 22, 2024 14:58
@m1kola

Copy link
Copy Markdown
MemberAuthor

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

@m1kola
m1kolaforce-pushed the add_ValidatingAdmissionPolicy branch 3 times, most recently from 5d45189 to 6537533CompareApril 23, 2024 10:23
Comment threadconfig/admission/admission.yaml Outdated
Comment threadconfig/admission/admission.yaml Outdated
@m1kola
m1kolaforce-pushed the add_ValidatingAdmissionPolicy branch 2 times, most recently from 0951051 to 4cadf14CompareApril 23, 2024 12:45
Mikalai Radchuk added 2 commits April 23, 2024 16:03
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
m1kolaforce-pushed the add_ValidatingAdmissionPolicy branch from 4cadf14 to e59ab41CompareApril 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 ownerApril 23, 2024 14:27
@openshift-ciopenshift-ciBot 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 joelanfordApril 23, 2024 14:28
@m1kolam1kola mentioned this pull request Apr 23, 2024
4 tasks

@joelanfordjoelanford left a comment

Copy link
Copy Markdown
Member

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 189b42aApr 24, 2024
@m1kola
m1kola deleted the add_ValidatingAdmissionPolicy branch April 25, 2024 08:20
Sign up for freeto 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.

3 participants

@m1kola@joelanford@grokspawn