Skip to content

Conversation

@nwnt
Copy link
Contributor

@nwnt nwnt commented Aug 11, 2025

Reverts #1152

We're moving to a different implementation on the AKS RP, so I'm reverting this one.

@nwnt nwnt changed the title Revert "feat: add managed resource webhook" revert "feat: add managed resource webhook" Aug 11, 2025
@nwnt nwnt changed the title revert "feat: add managed resource webhook" revert: "feat: add managed resource webhook" Aug 11, 2025
@nwnt nwnt force-pushed the revert-1152-nwnt/add-managed-resource-webhook branch from fd1482c to 0be3c62 Compare August 13, 2025 15:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts the previously added managed resource webhook functionality. The change removes the webhook that was designed to validate operations on ARM-managed resources in the fleet management system.

  • Removes the managed resource webhook validation logic and associated tests
  • Updates webhook configuration to reflect the removal of the managed resource validator
  • Makes a function visibility change in the user validation module (capitalizing function name)

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/e2e/webhook_test.go Removes ARM managed resource webhook end-to-end tests and related imports
test/e2e/utils_test.go Removes utility functions for creating and managing test namespaces for managed resources
test/e2e/resources_test.go Removes managed namespace template constant
pkg/webhook/webhook_test.go Updates expected webhook count from 10 to 9 after removal
pkg/webhook/webhook.go Removes managed resource webhook registration and configuration
pkg/webhook/validation/uservalidation.go Changes function name from exported to unexported (IsAdminGroupUserOrWhiteListedUser to isAdminGroupUserOrWhiteListedUser)
pkg/webhook/managedresource/managedresource_validating_webhook_test.go Completely removes the managed resource webhook test file
pkg/webhook/managedresource/managedresource_validating_webhook.go Completely removes the managed resource webhook implementation
pkg/webhook/add_handler.go Removes managed resource webhook registration from initialization

namespacedName := types.NamespacedName{Name: req.Name, Namespace: req.Namespace}
userInfo := req.UserInfo
if checkCRDGroup(group) && !IsAdminGroupUserOrWhiteListedUser(whiteListedUsers, userInfo) {
if checkCRDGroup(group) && !isAdminGroupUserOrWhiteListedUser(whiteListedUsers, userInfo) {
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The function IsAdminGroupUserOrWhiteListedUser was changed to isAdminGroupUserOrWhiteListedUser (unexported), but it's still being called from another function. This creates an inconsistency where the function is now unexported but still used as if it were a public API. Consider whether this function should remain exported or if all callers should be updated to use internal validation logic.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@Arvindthiru Arvindthiru left a comment

Choose a reason for hiding this comment

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

LGTM

@nwnt nwnt merged commit 0748ec9 into main Aug 14, 2025
18 checks passed
@nwnt nwnt deleted the revert-1152-nwnt/add-managed-resource-webhook branch August 14, 2025 16:05
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.

3 participants