Skip to content

Conversation

@nwnt
Copy link
Contributor

@nwnt nwnt commented Aug 21, 2025

Description of your changes

Jim had a discussion about this. We want to install this VAP into managed clusters via kubefleet crd install instead of onto CCP.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Unit tests.

Special notes for your reviewer

N/A

@nwnt nwnt changed the title [feature] Add ValidatingAdmissionPolicy for managedresource [feat] Add ValidatingAdmissionPolicy for managedresource Aug 21, 2025
@nwnt nwnt changed the title [feat] Add ValidatingAdmissionPolicy for managedresource feat: Add ValidatingAdmissionPolicy for managedresource Aug 21, 2025
@nwnt nwnt force-pushed the nwnt/add-managed-resource-vap branch from 90d3f41 to 6d2eee1 Compare August 21, 2025 16:13
Signed-off-by: Nont <[email protected]>
jim-minter
jim-minter previously approved these changes Aug 21, 2025
Copy link
Member

@jim-minter jim-minter left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Nont <[email protected]>
Signed-off-by: Nont <[email protected]>
@nwnt nwnt force-pushed the nwnt/add-managed-resource-vap branch from 7002541 to e769fbf Compare August 21, 2025 23:29
jim-minter
jim-minter previously approved these changes Aug 21, 2025
Copy link
Member

@jim-minter jim-minter left a comment

Choose a reason for hiding this comment

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

LGTM

Rule: admv1.Rule{
APIGroups: []string{""},
Resources: []string{"namespaces"},
APIVersions: []string{"*"},
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any other version for namespace being used?

RuleWithOperations: admv1.RuleWithOperations{
Rule: admv1.Rule{
APIGroups: []string{"placement.kubernetes-fleet.io"},
Resources: []string{"clusterresourceplacements"},
Copy link
Contributor

Choose a reason for hiding this comment

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

just CRP? Why would we allow any resources managed by ARM to be touched?

Comment on lines 76 to 80
var vap admissionregistrationv1.ValidatingAdmissionPolicy
Expect(hubClient.Get(ctx, types.NamespacedName{Name: vapName}, &vap)).Should(Succeed(), "ValidatingAdmissionPolicy should be installed")

var vapBinding admissionregistrationv1.ValidatingAdmissionPolicyBinding
Expect(hubClient.Get(ctx, types.NamespacedName{Name: vapBindingName}, &vapBinding)).Should(Succeed(), "ValidatingAdmissionPolicyBinding should be installed")
Copy link
Contributor

Choose a reason for hiding this comment

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

BeforeAll is mostly for setups. These two are testing implementations rather than expected behavior.

@nwnt nwnt force-pushed the nwnt/add-managed-resource-vap branch from c1ed13d to 74eac8c Compare August 23, 2025 00:18
@nwnt nwnt merged commit 4ca6ded into Azure:main Aug 25, 2025
27 of 30 checks passed
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.

4 participants