Skip to content

fix: auth distributor and crd serving#12

Closed
zachsmith1 wants to merge 1 commit intomainfrom
fix/authdistributor
Closed

fix: auth distributor and crd serving#12
zachsmith1 wants to merge 1 commit intomainfrom
fix/authdistributor

Conversation

@zachsmith1
Copy link
Contributor

This pull request introduces several important improvements to multicluster authentication, authorization, and CRD runtime handling. The changes focus on making the system more robust against nil pointer errors and panics, improving error handling and test coverage, and enhancing the reliability of CRD runtime lookups. Below are the most significant changes grouped by theme:

Authentication and Authorization Robustness:

  • Added generic utilities in pkg/multicluster/auth/dispatcher.go to safely handle typed nils and recover from panics in Authenticator and Authorizer implementations, ensuring the system denies requests gracefully instead of crashing. This includes new helpers like isNil, authenticateSafely, and authorizeSafely.
  • Improved validation of authorization attributes to deny requests with nil or invalid user info, preventing nil dereference errors during authorization.
  • Updated ClusterAuthenticator and ClusterAuthorizer logic to use the new safe wrappers and validation, and to handle typed nils correctly throughout the dispatch process.

Admission Webhook User Info Safety:

  • Introduced EnsureVersionedAttributesUserInfo in pkg/multicluster/admission/webhook/generic/versioned_attributes.go to guarantee that admission webhook requests always have a non-nil user.Info, preventing upstream panics.
  • Updated mutating and validating webhook dispatchers to use this new utility when constructing admission objects. [

CRD Runtime Manager Improvements:

  • Enhanced CRDRuntimeManager to reconcile CRD serving state from a shared projection and wait briefly for updates before returning a not-served result, improving reliability during CRD install/update events.
  • Changed the handler used for the shared CRD runtime to Director for improved request routing.

API Server Handler Wrapping:

  • Consolidated and standardized the wrapping of cluster CRD handlers in cmd/apiserver/app/config.go by introducing wrapClusterCRDHandler, ensuring consistent application of filters and error handling.

@zachsmith1 zachsmith1 changed the title fix: auth distributor fix: auth distributor and crd serving fix Feb 20, 2026
@zachsmith1 zachsmith1 changed the title fix: auth distributor and crd serving fix fix: auth distributor and crd serving Feb 20, 2026
@zachsmith1 zachsmith1 closed this Mar 3, 2026
@zachsmith1 zachsmith1 deleted the fix/authdistributor branch March 3, 2026 06:19
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.

1 participant