Skip to content

feat: implement Restricted CRDs with RBACPolicy for multi-tenant RBAC governance#224

Open
MaxRink wants to merge 10 commits intomainfrom
pr-56
Open

feat: implement Restricted CRDs with RBACPolicy for multi-tenant RBAC governance#224
MaxRink wants to merge 10 commits intomainfrom
pr-56

Conversation

@MaxRink
Copy link
Copy Markdown
Collaborator

@MaxRink MaxRink commented Mar 10, 2026

Summary

Implements the restricted CRD proposal from #56, adding three new cluster-scoped CRDs that enable multi-tenant RBAC governance through policy-constrained role and binding definitions.

New CRDs

CRD Purpose
RBACPolicy Defines constraints (allowed verbs, resources, role refs, namespaces, subject kinds) that restricted definitions must comply with
RestrictedRoleDefinition Creates Roles/ClusterRoles with policy-enforced limits — forbidden verbs, resources, and APIs are automatically excluded
RestrictedBindDefinition Creates RoleBindings/ClusterRoleBindings with policy-enforced limits — subject kinds, role refs, and namespace targeting are validated

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Configuration change
  • 🧪 Test improvement
  • 🏗️ Refactoring (no functional changes)

Architecture

RBACPolicy (cluster-scoped)
├── Defines constraints: forbidden verbs, resources, APIs, allowed role refs, namespace limits
├── Referenced by RestrictedRoleDefinition and RestrictedBindDefinition via policyRef
├── Deletion-protected when bound resources exist (webhook validation)
└── Tracks boundResourceCount in status

RestrictedRoleDefinition (cluster-scoped)
├── Extends RoleDefinition with policyRef, restrictedApis, restrictedVerbs
├── Policy compliance validated at admission (webhook) and reconciliation
├── Forbidden verbs/resources/APIs filtered during role generation
└── Status: Ready + PolicyCompliant conditions

RestrictedBindDefinition (cluster-scoped)
├── Extends BindDefinition with policyRef
├── Policy compliance validated at admission (webhook) and reconciliation
├── Subject kinds, role refs, namespace targeting enforced by policy
└── Status: Ready + PolicyCompliant conditions

Key Design Decisions

  • Policy library (pkg/policy/): Reusable validation engine with Validate() returning structured []Violation results
  • Server-Side Apply: All managed RBAC resources use SSA with FieldOwner("auth-operator"), cache-aware diff-before-apply
  • Shared helpers (internal/controller/authorization/shared_helpers.go): Extracted common patterns (namespace enumeration, SA creation, RBAC cleanup) to reduce duplication
  • Webhook validation: Immutable policyRef after creation, policy existence checks, deletion protection for bound policies
  • Condition management: Ready + PolicyCompliant conditions using pkg/conditions with kstatus pattern
  • Finalizer-based cleanup: Both controllers use finalizers to ensure RBAC resources are cleaned up on deletion
  • Index-based lookups: Field indexes on spec.policyRef.name for efficient policy→resource reverse lookups

Implementation

New Files

  • api/authorization/v1alpha1/rbacpolicy_types.go — RBACPolicy CRD schema
  • api/authorization/v1alpha1/restrictedbinddefinition_types.go — RestrictedBindDefinition CRD schema
  • api/authorization/v1alpha1/restrictedroledefinition_types.go — RestrictedRoleDefinition CRD schema
  • api/authorization/v1alpha1/rbacpolicy_webhook.go — RBACPolicy validation webhook (deletion protection)
  • api/authorization/v1alpha1/restrictedbinddefinition_webhook.go — RestrictedBindDefinition validation webhook
  • api/authorization/v1alpha1/restrictedroledefinition_webhook.go — RestrictedRoleDefinition validation webhook
  • internal/controller/authorization/restrictedroledefinition_controller.go — RestrictedRoleDefinition reconciler
  • internal/controller/authorization/restrictedbinddefinition_controller.go — RestrictedBindDefinition reconciler
  • internal/controller/authorization/rbacpolicy_controller.go — RBACPolicy reconciler (status tracking)
  • internal/controller/authorization/shared_helpers.go — Shared controller helpers
  • pkg/policy/ — Policy validation library with comprehensive tests

Modified Files

  • cmd/controller.go — Wire new controllers with concurrency flags
  • cmd/webhook.go — Wire new webhook handlers
  • cmd/root.go — Register new types in scheme
  • pkg/indexer/ — Add field indexes for policyRef lookups
  • pkg/ssa/ — Add apply configuration builders for new types
  • Helm chart: CRDs, webhook template, values

Related Issues

Closes #56

Testing

Unit Tests

  • Policy library: 100% coverage
  • Controllers: 78.2% coverage
  • Webhooks: 81.0% coverage

E2E Tests

New restricted_e2e_test.go covering:

  • RBACPolicy CRUD and status tracking
  • RestrictedBindDefinition lifecycle (create → verify RBAC → cleanup)
  • RestrictedRoleDefinition lifecycle (create → verify Role → cleanup)
  • Policy violation detection
  • Deletion protection for bound policies
  • CRD installation verification

Samples

Comprehensive sample CRs in config/samples/:

  • authorization_v1alpha1_rbacpolicy.yaml — 4 policies (workload, cross-namespace, CI/CD, compliance)
  • authorization_v1alpha1_restrictedbinddefinition.yaml — 3 bindings (SA-only, platform operator, CI deploy)
  • authorization_v1alpha1_restrictedroledefinition.yaml — 3 roles (namespaced reader, cluster reader, CI deploy)

Test Configuration

  • Kubernetes version: 1.34.1
  • Operator version: dev (this PR)
  • Test environment: kind cluster (E2E), envtest (unit/integration)

API Changes

  • New CRD fields added
  • RBACPolicy CRD: spec.appliesTo, spec.roleLimits, spec.bindingLimits, spec.subjectLimits
  • RestrictedRoleDefinition CRD: spec.policyRef, spec.restrictedApis, spec.restrictedVerbs
  • RestrictedBindDefinition CRD: spec.policyRef

CLI Flags

New controller concurrency flags:

  • --restrictedbinddefinition-concurrency (default: 5)
  • --restrictedroledefinition-concurrency (default: 5)

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Implementation Checklist

  • CRD types with kubebuilder markers
  • DeepCopy generated (make generate)
  • CRDs generated (make manifests)
  • Validation webhooks (CREATE/UPDATE + DELETE protection)
  • Controllers with SSA, finalizers, conditions
  • Policy validation library (pkg/policy/)
  • Field indexes for efficient lookups
  • Shared helpers to reduce duplication
  • Helm chart updated (CRDs, webhooks, values)
  • Sample CRs for all use cases
  • Unit tests (>70% coverage)
  • E2E tests
  • API documentation regenerated
  • SPDX headers / REUSE compliance

@MaxRink MaxRink requested a review from a team as a code owner March 10, 2026 22:35
Copilot AI review requested due to automatic review settings March 10, 2026 22:35
@github-actions github-actions bot added documentation Improvements or additions to documentation api tests config size/XL labels Mar 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 2026

📊 Output Delta Report

Generated RBAC resources from config/samples/ compared across branches.

Prometheus Metrics (PR branch)

📈 auth_operator_* metrics
auth_operator_api_discovery_duration_seconds_bucket{le="+Inf"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="0.005"} 0
auth_operator_api_discovery_duration_seconds_bucket{le="0.01"} 0
auth_operator_api_discovery_duration_seconds_bucket{le="0.025"} 1
auth_operator_api_discovery_duration_seconds_bucket{le="0.05"} 1
auth_operator_api_discovery_duration_seconds_bucket{le="0.1"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="0.25"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="0.5"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="1"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="10"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="2.5"} 2
auth_operator_api_discovery_duration_seconds_bucket{le="5"} 2
auth_operator_api_discovery_duration_seconds_count 2
auth_operator_api_discovery_duration_seconds_sum 0.081458945
auth_operator_api_discovery_errors_total 0
auth_operator_authorizer_active_rules 0
auth_operator_authorizer_rate_limited_total 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-cluster-only"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-complex-selectors"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-default-ns-test"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-disjoint-selectors"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-generated-sa"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-missing-clusterrole"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-missing-role"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-missing-role-policy-error-valid"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-missing-role-policy-ignore"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-missing-role-policy-warn"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-mixed-refs"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-preexisting-role"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-preexisting-sa"} 1
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-shared-generated-sa-a"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-shared-generated-sa-b"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-shared-sa-consumer-a"} 1
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-edge-shared-sa-consumer-b"} 1
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-gitops-controllers"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-mixed-binding-types"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-monitoring-stack"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-namespace-only"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-overlapping-selectors"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-platform-admins"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-readonly-ui"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-security-auditors"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-tenant-alpha-team"} 0
auth_operator_external_serviceaccounts_referenced{binddefinition="bd-tenant-beta-team"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-cluster-only",resource_type="ClusterRoleBinding"} 2
auth_operator_managed_resources{controller="BindDefinition",name="bd-cluster-only",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-cluster-only",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-complex-selectors",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-complex-selectors",resource_type="RoleBinding"} 27
auth_operator_managed_resources{controller="BindDefinition",name="bd-complex-selectors",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-default-ns-test",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-default-ns-test",resource_type="RoleBinding"} 4
auth_operator_managed_resources{controller="BindDefinition",name="bd-default-ns-test",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-disjoint-selectors",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-disjoint-selectors",resource_type="RoleBinding"} 6
auth_operator_managed_resources{controller="BindDefinition",name="bd-disjoint-selectors",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-generated-sa",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-generated-sa",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-generated-sa",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-clusterrole",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-clusterrole",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-clusterrole",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-error-valid",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-error-valid",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-error-valid",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-ignore",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-ignore",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-ignore",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-warn",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-warn",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-missing-role-policy-warn",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-mixed-refs",resource_type="ClusterRoleBinding"} 3
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-mixed-refs",resource_type="RoleBinding"} 2
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-mixed-refs",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-role",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-role",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-role",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-sa",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-sa",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-preexisting-sa",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-a",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-a",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-a",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-b",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-b",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-generated-sa-b",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-a",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-a",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-a",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-b",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-b",resource_type="RoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-edge-shared-sa-consumer-b",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-gitops-controllers",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-gitops-controllers",resource_type="RoleBinding"} 6
auth_operator_managed_resources{controller="BindDefinition",name="bd-gitops-controllers",resource_type="ServiceAccount"} 6
auth_operator_managed_resources{controller="BindDefinition",name="bd-mixed-binding-types",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-mixed-binding-types",resource_type="RoleBinding"} 24
auth_operator_managed_resources{controller="BindDefinition",name="bd-mixed-binding-types",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-monitoring-stack",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-monitoring-stack",resource_type="RoleBinding"} 4
auth_operator_managed_resources{controller="BindDefinition",name="bd-monitoring-stack",resource_type="ServiceAccount"} 5
auth_operator_managed_resources{controller="BindDefinition",name="bd-namespace-only",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-namespace-only",resource_type="RoleBinding"} 4
auth_operator_managed_resources{controller="BindDefinition",name="bd-namespace-only",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-overlapping-selectors",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-overlapping-selectors",resource_type="RoleBinding"} 5
auth_operator_managed_resources{controller="BindDefinition",name="bd-overlapping-selectors",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-platform-admins",resource_type="ClusterRoleBinding"} 2
auth_operator_managed_resources{controller="BindDefinition",name="bd-platform-admins",resource_type="RoleBinding"} 3
auth_operator_managed_resources{controller="BindDefinition",name="bd-platform-admins",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-readonly-ui",resource_type="ClusterRoleBinding"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-readonly-ui",resource_type="RoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-readonly-ui",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-security-auditors",resource_type="ClusterRoleBinding"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-security-auditors",resource_type="RoleBinding"} 14
auth_operator_managed_resources{controller="BindDefinition",name="bd-security-auditors",resource_type="ServiceAccount"} 0
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-alpha-team",resource_type="ClusterRoleBinding"} 2
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-alpha-team",resource_type="RoleBinding"} 20
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-alpha-team",resource_type="ServiceAccount"} 1
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-beta-team",resource_type="ClusterRoleBinding"} 3
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-beta-team",resource_type="RoleBinding"} 2
auth_operator_managed_resources{controller="BindDefinition",name="bd-tenant-beta-team",resource_type="ServiceAccount"} 1
auth_operator_namespace_fanout_enqueued_total 60
auth_operator_namespace_fanout_skipped_total 511
auth_operator_namespaces_active{binddefinition="bd-cluster-only"} 0
auth_operator_namespaces_active{binddefinition="bd-complex-selectors"} 9
auth_operator_namespaces_active{binddefinition="bd-default-ns-test"} 2
auth_operator_namespaces_active{binddefinition="bd-disjoint-selectors"} 6
auth_operator_namespaces_active{binddefinition="bd-edge-generated-sa"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-missing-clusterrole"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-missing-role"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-missing-role-policy-error-valid"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-missing-role-policy-ignore"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-missing-role-policy-warn"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-mixed-refs"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-preexisting-role"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-preexisting-sa"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-shared-generated-sa-a"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-shared-generated-sa-b"} 1
auth_operator_namespaces_active{binddefinition="bd-edge-shared-sa-consumer-a"} 0
auth_operator_namespaces_active{binddefinition="bd-edge-shared-sa-consumer-b"} 0
auth_operator_namespaces_active{binddefinition="bd-gitops-controllers"} 2
auth_operator_namespaces_active{binddefinition="bd-mixed-binding-types"} 6
auth_operator_namespaces_active{binddefinition="bd-monitoring-stack"} 2
auth_operator_namespaces_active{binddefinition="bd-namespace-only"} 2
auth_operator_namespaces_active{binddefinition="bd-overlapping-selectors"} 5
auth_operator_namespaces_active{binddefinition="bd-platform-admins"} 3
auth_operator_namespaces_active{binddefinition="bd-readonly-ui"} 1
auth_operator_namespaces_active{binddefinition="bd-security-auditors"} 7
auth_operator_namespaces_active{binddefinition="bd-tenant-alpha-team"} 4
auth_operator_namespaces_active{binddefinition="bd-tenant-beta-team"} 1
auth_operator_namespaces_active{binddefinition="rbd-case-allowed-all-paths"} 1
auth_operator_namespaces_active{binddefinition="rbd-case-impersonated-allowed"} 1
auth_operator_namespaces_active{binddefinition="rbd-case-partial-missing-role-refs"} 1
auth_operator_namespaces_active{binddefinition="rbd-ci-deploy"} 0
auth_operator_namespaces_active{binddefinition="rbd-platform-operator"} 0
auth_operator_policy_violations_active{controller="RestrictedBindDefinition"} 3
auth_operator_policy_violations_active{controller="RestrictedRoleDefinition"} 8
auth_operator_rbac_resources_applied_total{resource_type="ClusterRole"} 4
auth_operator_rbac_resources_applied_total{resource_type="ClusterRoleBinding"} 5
auth_operator_rbac_resources_applied_total{resource_type="Role"} 2
auth_operator_rbac_resources_applied_total{resource_type="RoleBinding"} 11
auth_operator_rbac_resources_skipped_total{resource_type="ClusterRole"} 70
auth_operator_rbac_resources_skipped_total{resource_type="ClusterRoleBinding"} 179
auth_operator_rbac_resources_skipped_total{resource_type="Role"} 42
auth_operator_rbac_resources_skipped_total{resource_type="RoleBinding"} 473
auth_operator_rbac_resources_skipped_total{resource_type="ServiceAccount"} 137
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="+Inf"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.005"} 165
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.01"} 167
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.025"} 170
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.05"} 171
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.1"} 173
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.25"} 179
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="0.5"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="1"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="10"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="2.5"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="BindDefinition",le="5"} 182
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="+Inf"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.005"} 0
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.01"} 1
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.025"} 9
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.05"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.1"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.25"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="0.5"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="1"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="10"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="2.5"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RBACPolicy",le="5"} 10
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="+Inf"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.005"} 61
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.01"} 64
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.025"} 66
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.05"} 69
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.1"} 70
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.25"} 72
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="0.5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="1"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="10"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="2.5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedBindDefinition",le="5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="+Inf"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.005"} 59
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.01"} 64
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.025"} 65
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.05"} 67
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.1"} 69
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.25"} 74
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="0.5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="1"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="10"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="2.5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RestrictedRoleDefinition",le="5"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="+Inf"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.005"} 85
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.01"} 85
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.025"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.05"} 87
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.1"} 87
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.25"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="0.5"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="1"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="10"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="2.5"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleBindingTerminator",le="5"} 89
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="+Inf"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.005"} 76
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.01"} 77
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.025"} 78
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.05"} 83
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.1"} 84
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.25"} 84
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="0.5"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="1"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="10"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="2.5"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="RoleDefinition",le="5"} 86
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="+Inf"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.005"} 24
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.01"} 39
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.025"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.05"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.1"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.25"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="0.5"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="1"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="10"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="2.5"} 42
auth_operator_reconcile_duration_seconds_bucket{controller="WebhookAuthorizer",le="5"} 42
auth_operator_reconcile_duration_seconds_count{controller="BindDefinition"} 182
auth_operator_reconcile_duration_seconds_count{controller="RBACPolicy"} 10
auth_operator_reconcile_duration_seconds_count{controller="RestrictedBindDefinition"} 77
auth_operator_reconcile_duration_seconds_count{controller="RestrictedRoleDefinition"} 77
auth_operator_reconcile_duration_seconds_count{controller="RoleBindingTerminator"} 89
auth_operator_reconcile_duration_seconds_count{controller="RoleDefinition"} 86
auth_operator_reconcile_duration_seconds_count{controller="WebhookAuthorizer"} 42
auth_operator_reconcile_duration_seconds_sum{controller="BindDefinition"} 2.317911519000001
auth_operator_reconcile_duration_seconds_sum{controller="RBACPolicy"} 0.150820349
auth_operator_reconcile_duration_seconds_sum{controller="RestrictedBindDefinition"} 2.383124935999999
auth_operator_reconcile_duration_seconds_sum{controller="RestrictedRoleDefinition"} 2.3063922109999986
auth_operator_reconcile_duration_seconds_sum{controller="RoleBindingTerminator"} 0.27310445899999997
auth_operator_reconcile_duration_seconds_sum{controller="RoleDefinition"} 0.9372506590000007
auth_operator_reconcile_duration_seconds_sum{controller="WebhookAuthorizer"} 0.248980548
auth_operator_reconcile_errors_total{controller="RestrictedBindDefinition",error_type="api"} 17
auth_operator_reconcile_errors_total{controller="RestrictedRoleDefinition",error_type="api"} 17
auth_operator_reconcile_total{controller="BindDefinition",result="degraded"} 38
auth_operator_reconcile_total{controller="BindDefinition",result="success"} 144
auth_operator_reconcile_total{controller="RBACPolicy",result="success"} 10
auth_operator_reconcile_total{controller="RestrictedBindDefinition",result="degraded"} 21
auth_operator_reconcile_total{controller="RestrictedBindDefinition",result="error"} 17
auth_operator_reconcile_total{controller="RestrictedBindDefinition",result="success"} 39
auth_operator_reconcile_total{controller="RestrictedRoleDefinition",result="degraded"} 28
auth_operator_reconcile_total{controller="RestrictedRoleDefinition",result="error"} 17
auth_operator_reconcile_total{controller="RestrictedRoleDefinition",result="success"} 32
auth_operator_reconcile_total{controller="RoleBindingTerminator",result="skipped"} 20
auth_operator_reconcile_total{controller="RoleBindingTerminator",result="success"} 69
auth_operator_reconcile_total{controller="RoleDefinition",result="success"} 86
auth_operator_reconcile_total{controller="WebhookAuthorizer",result="success"} 42
auth_operator_role_refs_missing{binddefinition="bd-cluster-only"} 0
auth_operator_role_refs_missing{binddefinition="bd-complex-selectors"} 0
auth_operator_role_refs_missing{binddefinition="bd-default-ns-test"} 0
auth_operator_role_refs_missing{binddefinition="bd-disjoint-selectors"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-generated-sa"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-missing-clusterrole"} 1
auth_operator_role_refs_missing{binddefinition="bd-edge-missing-role"} 1
auth_operator_role_refs_missing{binddefinition="bd-edge-missing-role-policy-error-valid"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-missing-role-policy-ignore"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-missing-role-policy-warn"} 1
auth_operator_role_refs_missing{binddefinition="bd-edge-mixed-refs"} 2
auth_operator_role_refs_missing{binddefinition="bd-edge-preexisting-role"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-preexisting-sa"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-shared-generated-sa-a"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-shared-generated-sa-b"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-shared-sa-consumer-a"} 0
auth_operator_role_refs_missing{binddefinition="bd-edge-shared-sa-consumer-b"} 0
auth_operator_role_refs_missing{binddefinition="bd-gitops-controllers"} 0
auth_operator_role_refs_missing{binddefinition="bd-mixed-binding-types"} 1
auth_operator_role_refs_missing{binddefinition="bd-monitoring-stack"} 0
auth_operator_role_refs_missing{binddefinition="bd-namespace-only"} 0
auth_operator_role_refs_missing{binddefinition="bd-overlapping-selectors"} 0
auth_operator_role_refs_missing{binddefinition="bd-platform-admins"} 0
auth_operator_role_refs_missing{binddefinition="bd-readonly-ui"} 0
auth_operator_role_refs_missing{binddefinition="bd-security-auditors"} 1
auth_operator_role_refs_missing{binddefinition="bd-tenant-alpha-team"} 2
auth_operator_role_refs_missing{binddefinition="bd-tenant-beta-team"} 0
auth_operator_role_refs_missing{binddefinition="rbd-case-allowed-all-paths"} 0
auth_operator_role_refs_missing{binddefinition="rbd-case-impersonated-allowed"} 0
auth_operator_role_refs_missing{binddefinition="rbd-case-partial-missing-role-refs"} 2
auth_operator_role_refs_missing{binddefinition="rbd-ci-deploy"} 1
auth_operator_role_refs_missing{binddefinition="rbd-platform-operator"} 1
auth_operator_serviceaccount_skipped_preexisting_total{binddefinition="bd-edge-preexisting-sa"} 7
auth_operator_serviceaccount_skipped_preexisting_total{binddefinition="bd-edge-shared-sa-consumer-a"} 7
auth_operator_serviceaccount_skipped_preexisting_total{binddefinition="bd-edge-shared-sa-consumer-b"} 7
auth_operator_status_resources_skipped_total{resource_type="BindDefinition"} 179
auth_operator_status_resources_skipped_total{resource_type="RoleDefinition"} 82

⚠️ Controller Logs

Errors/Warnings Found in Logs (click to expand)

Error Summary from Controller Logs

pr-auth-operator-system-controller.log

I0408 12:01:41.323741       1 priorityqueue.go:527] "workqueue_items" controller="binddefinition" items=[{"key":{"Namespace":"","Name":"bd-platform-admins"},"addedCounter":320,"priority":-100,"readyAt":"2026-04-08T12:02:21.549026839Z"},{"key":{"Namespace":"","Name":"bd-monitoring-stack"},"addedCounter":322,"priority":-100,"readyAt":"2026-04-08T12:02:21.553944205Z"},{"key":{"Namespace":"","Name":"bd-overlapping-selectors"},"addedCounter":324,"priority":-100,"readyAt":"2026-04-08T12:02:21.57279095Z"},{"key":{"Namespace":"","Name":"bd-readonly-ui"},"addedCounter":327,"priority":-100,"readyAt":"2026-04-08T12:02:21.595023713Z"},{"key":{"Namespace":"","Name":"bd-namespace-only"},"addedCounter":328,"priority":-100,"readyAt":"2026-04-08T12:02:21.595316661Z"},{"key":{"Namespace":"","Name":"bd-edge-preexisting-role"},"addedCounter":331,"priority":-100,"readyAt":"2026-04-08T12:02:21.598552588Z"},{"key":{"Namespace":"","Name":"bd-edge-preexisting-sa"},"addedCounter":332,"priority":-100,"readyAt":"2026-04-08T12:02:21.598764472Z"},{"key":{"Namespace":"","Name":"bd-default-ns-test"},"addedCounter":334,"priority":-100,"readyAt":"2026-04-08T12:02:21.602808616Z"},{"key":{"Namespace":"","Name":"bd-edge-shared-generated-sa-b"},"addedCounter":336,"priority":-100,"readyAt":"2026-04-08T12:02:21.60493934Z"},{"key":{"Namespace":"","Name":"bd-disjoint-selectors"},"addedCounter":338,"priority":-100,"readyAt":"2026-04-08T12:02:21.614515473Z"},{"key":{"Namespace":"","Name":"bd-edge-shared-sa-consumer-a"},"addedCounter":340,"priority":-100,"readyAt":"2026-04-08T12:02:21.616554845Z"},{"key":{"Namespace":"","Name":"bd-edge-shared-generated-sa-a"},"addedCounter":342,"priority":-100,"readyAt":"2026-04-08T12:02:21.622953438Z"},{"key":{"Namespace":"","Name":"bd-cluster-only"},"addedCounter":344,"priority":-100,"readyAt":"2026-04-08T12:02:21.62656593Z"},{"key":{"Namespace":"","Name":"bd-edge-shared-sa-consumer-b"},"addedCounter":346,"priority":-100,"readyAt":"2026-04-08T12:02:21.628344081Z"},{"key":{"Namespace":"","Name":"bd-gitops-controllers"},"addedCounter":348,"priority":-100,"readyAt":"2026-04-08T12:02:21.711524196Z"},{"key":{"Namespace":"","Name":"bd-complex-selectors"},"addedCounter":352,"priority":0,"readyAt":"2026-04-08T12:02:21.719846756Z"},{"key":{"Namespace":"","Name":"bd-edge-generated-sa"},"addedCounter":353,"priority":-100,"readyAt":"2026-04-08T12:02:21.720818815Z"},{"key":{"Namespace":"","Name":"bd-tenant-beta-team"},"addedCounter":354,"priority":-100,"readyAt":"2026-04-08T12:02:21.72159622Z"},{"key":{"Namespace":"","Name":"bd-edge-missing-role-policy-ignore"},"addedCounter":356,"priority":0,"readyAt":"2026-04-08T12:02:21.89426945Z"},{"key":{"Namespace":"","Name":"bd-edge-missing-role-policy-error-valid"},"addedCounter":358,"priority":0,"readyAt":"2026-04-08T12:02:21.95972074Z"},{"key":{"Namespace":"","Name":"bd-edge-missing-role-policy-warn"},"addedCounter":278,"priority":0,"readyAt":"2026-04-08T12:02:41.900845509Z"},{"key":{"Namespace":"","Name":"bd-edge-missing-role"},"addedCounter":266,"priority":-100,"readyAt":"2026-04-08T12:05:01.551375768Z"},{"key":{"Namespace":"","Name":"bd-tenant-alpha-team"},"addedCounter":268,"priority":-100,"readyAt":"2026-04-08T12:05:01.590370858Z"},{"key":{"Namespace":"","Name":"bd-edge-missing-clusterrole"},"addedCounter":270,"priority":-100,"readyAt":"2026-04-08T12:05:01.598296793Z"},{"key":{"Namespace":"","Name":"bd-mixed-binding-types"},"addedCounter":272,"priority":-100,"readyAt":"2026-04-08T12:05:01.613150024Z"},{"key":{"Namespace":"","Name":"bd-edge-mixed-refs"},"addedCounter":274,"priority":-100,"readyAt":"2026-04-08T12:05:01.705570548Z"},{"key":{"Namespace":"","Name":"bd-security-auditors"},"addedCounter":276,"priority":-100,"readyAt":"2026-04-08T12:05:01.711115824Z"}]
I0408 12:01:41.332186       1 priorityqueue.go:527] "workqueue_items" controller="restrictedroledefinition" items=[{"key":{"Namespace":"","Name":"rrd-case-blocked-clusterrole-by-policy"},"addedCounter":142,"priority":0,"readyAt":"2026-04-08T12:02:21.799307178Z"},{"key":{"Namespace":"","Name":"rrd-case-blocked-forbidden-verb-omission"},"addedCounter":144,"priority":0,"readyAt":"2026-04-08T12:02:21.870079201Z"},{"key":{"Namespace":"","Name":"rrd-case-partial-filtered-rules"},"addedCounter":146,"priority":0,"readyAt":"2026-04-08T12:02:21.8773622Z"},{"key":{"Namespace":"","Name":"rrd-case-allowed-clusterrole"},"addedCounter":148,"priority":0,"readyAt":"2026-04-08T12:02:21.926354569Z"},{"key":{"Namespace":"","Name":"rrd-operator-reader"},"addedCounter":150,"priority":0,"readyAt":"2026-04-08T12:02:21.954375888Z"},{"key":{"Namespace":"","Name":"rrd-case-impersonated-allowed"},"addedCounter":152,"priority":0,"readyAt":"2026-04-08T12:02:21.973308186Z"},{"key":{"Namespace":"","Name":"rrd-team-alpha-reader"},"addedCounter":155,"priority":0,"readyAt":"2026-04-08T12:02:21.993829443Z"},{"key":{"Namespace":"","Name":"rrd-ci-deploy-writer"},"addedCounter":156,"priority":0,"readyAt":"2026-04-08T12:02:21.993845663Z"},{"key":{"Namespace":"","Name":"rrd-case-impersonated-authz-failure"},"addedCounter":140,"priority":0,"readyAt":"2026-04-08T12:06:17.40524874Z"}]
I0408 12:01:41.334349       1 priorityqueue.go:527] "workqueue_items" controller="restrictedbinddefinition" items=[{"key":{"Namespace":"","Name":"rbd-case-blocked-crb-by-policy"},"addedCounter":143,"priority":0,"readyAt":"2026-04-08T12:02:21.855408601Z"},{"key":{"Namespace":"","Name":"rbd-case-blocked-subject-kind"},"addedCounter":145,"priority":0,"readyAt":"2026-04-08T12:02:21.865680907Z"},{"key":{"Namespace":"","Name":"rbd-team-alpha-sa"},"addedCounter":147,"priority":0,"readyAt":"2026-04-08T12:02:21.96005216Z"},{"key":{"Namespace":"","Name":"rbd-case-partial-missing-role-refs"},"addedCounter":149,"priority":0,"readyAt":"2026-04-08T12:02:21.97172347Z"},{"key":{"Namespace":"","Name":"rbd-platform-operator"},"addedCounter":151,"priority":0,"readyAt":"2026-04-08T12:02:22.000403167Z"},{"key":{"Namespace":"","Name":"rbd-ci-deploy"},"addedCounter":154,"priority":0,"readyAt":"2026-04-08T12:02:22.006312731Z"},{"key":{"Namespace":"","Name":"rbd-case-impersonated-allowed"},"addedCounter":155,"priority":0,"readyAt":"2026-04-08T12:02:22.007457568Z"},{"key":{"Namespace":"","Name":"rbd-case-allowed-all-paths"},"addedCounter":157,"priority":0,"readyAt":"2026-04-08T12:02:22.044399302Z"},{"key":{"Namespace":"","Name":"rbd-case-impersonated-authz-failure"},"addedCounter":141,"priority":0,"readyAt":"2026-04-08T12:06:17.403773879Z"}]
I0408 11:55:04.223757       1 leaderelection.go:267] "Failed to acquire lease" lock="auth-operator-system/auth.t-caas.telekom.com"
I0408 11:55:07.155850       1 leaderelection.go:267] "Failed to acquire lease" lock="auth-operator-system/auth.t-caas.telekom.com"
I0408 11:55:11.425688       1 leaderelection.go:267] "Failed to acquire lease" lock="auth-operator-system/auth.t-caas.telekom.com"
I0408 11:55:13.982373       1 leaderelection.go:267] "Failed to acquire lease" lock="auth-operator-system/auth.t-caas.telekom.com"
I0408 11:55:17.128337       1 leaderelection.go:267] "Failed to acquire lease" lock="auth-operator-system/auth.t-caas.telekom.com"
I0408 11:55:21.425829       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="kube-node-lease" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.427525       1 binddefinition_controller.go:238] "enqueuing BindDefinition reconciliation" namespace="tenant-beta" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.428011       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="sample-authz" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.428613       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="t-caas-system" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.429307       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="tenant-alpha-staging" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.429719       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="kube-public" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.430351       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="local-path-storage" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.430917       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="sample-tenant-a" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.441776       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="tenant-alpha" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.447741       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="tenant-alpha-prod" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.448274       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="argocd" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.457706       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="sample-tenant-b" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.460297       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="kube-system" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.461697       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="flux-system" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.461876       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="t-caas-logging" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.463777       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="t-caas-monitoring" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.464384       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="compliance-pci" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.465697       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="auth-operator-system" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.467391       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="tenant-alpha-cicd" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.471683       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="shared-services" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.472123       1 binddefinition_controller.go:232] "skipping BindDefinition (no matching selector)" namespace="default" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.592020       1 controller.go:478] "Reconciling" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087"
I0408 11:55:21.592067       1 binddefinition_controller.go:380] "=== Reconcile START ===" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.592131       1 binddefinition_controller.go:394] "Fetching BindDefinition from API" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.592184       1 binddefinition_controller.go:412] "BindDefinition fetched successfully" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" generation=1 resourceVersion="3261" isDeleting=false subjectCount=1 clusterRoleRefCount=1 roleBindingCount=1
I0408 11:55:21.592258       1 binddefinition_controller.go:447] "Marking BindDefinition as Reconciling" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" generation=1
I0408 11:55:21.592297       1 binddefinition_controller.go:455] "Adding finalizer to BindDefinition" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.834649       1 controller.go:478] "Reconciling" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd"
I0408 11:55:21.834745       1 rbacpolicy_controller.go:131] "=== Reconcile START ===" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd" rbacPolicy="sample-policy-impersonation-authz-failure"
I0408 11:55:21.834875       1 rbacpolicy_controller.go:196] "bound resource count updated" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd" rbacPolicy="sample-policy-impersonation-authz-failure" restrictedBindDefinitions=0 restrictedRoleDefinitions=0 totalBound=0
I0408 11:55:21.844224       1 rbacpolicy_controller.go:213] "Reconcile completed successfully" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd" rbacPolicy="sample-policy-impersonation-authz-failure"
I0408 11:55:21.844355       1 rbacpolicy_controller.go:136] "=== Reconcile END ===" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd" rbacPolicy="sample-policy-impersonation-authz-failure" duration="9.608325ms"
I0408 11:55:21.844446       1 controller.go:510] "Reconcile successful" controller="rbacpolicy" controllerGroup="authorization.t-caas.telekom.com" controllerKind="RBACPolicy" RBACPolicy="sample-policy-impersonation-authz-failure" namespace="" name="sample-policy-impersonation-authz-failure" reconcileID="ee1cc3d6-37d5-430f-87a3-cb666f89eddd"
I0408 11:55:21.846052       1 binddefinition_controller.go:475] "Collecting namespaces for BindDefinition" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.846192       1 binddefinition_controller.go:485] "Namespaces collected" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" totalNamespaces=1
I0408 11:55:21.846308       1 binddefinition_controller.go:491] "Active namespaces filtered" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" activeNamespaceCount=1 activeNamespaceNames=["tenant-beta"]
I0408 11:55:21.846413       1 binddefinition_controller.go:499] "Starting resource reconciliation" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" subjects=1 clusterRoleRefs=1 roleBindings=1
I0408 11:55:21.846533       1 binddefinition_controller.go:619] "reconcileResources: Starting" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" activeNamespaceCount=1
I0408 11:55:21.846618       1 binddefinition_controller.go:625] "reconcileResources: Using missing-role policy" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" policy="error"
I0408 11:55:21.846684       1 binddefinition_controller.go:632] "reconcileResources: Validating role references" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid"
I0408 11:55:21.846847       1 binddefinition_controller.go:641] "reconcileResources: Role reference validation complete" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" missingCount=0 missingRoles=null
I0408 11:55:21.846926       1 binddefinition_controller.go:676] "reconcileResources: Ensuring ServiceAccounts" controller="binddefinition" controllerGroup="authorization.t-caas.telekom.com" controllerKind="BindDefinition" BindDefinition="bd-edge-missing-role-policy-error-valid" namespace="" name="bd-edge-missing-role-policy-error-valid" reconcileID="94811fbd-517b-4bb4-8cad-786d0231d087" bindDefinition="bd-edge-missing-role-policy-error-valid" subjectCount=1

pr-auth-operator-system-webhook.log

I0408 11:55:21.971879       1 restrictedroledefinition_webhook.go:76] "validating update" logger="admission.restrictedroledefinition-webhook" webhookGroup="authorization.t-caas.telekom.com" webhookKind="RestrictedRoleDefinition" RestrictedRoleDefinition="rrd-case-impersonated-authz-failure" namespace="" name="rrd-case-impersonated-authz-failure" resource={"group":"authorization.t-caas.telekom.com","version":"v1alpha1","resource":"restrictedroledefinitions"} user="system:serviceaccount:auth-operator-system:auth-operator-manager" requestID="988f2819-bf52-46e7-9333-4a92073f4ae9"

Warning/Error Events (ALL)

default                5m26s       Warning   PolicyViolation             restrictedbinddefinition/rbd-team-alpha-sa                                                                     RestrictedBindDefinitionReconciler, RestrictedBindDefinitionReconciler-auth-operator-controller-manager-57bb5c8475-fbxvm   Policy violations detected: spec.subjects[0].namespace: ServiceAccount namespace "team-alpha" is not in the allowed creation namespaces                                                                                                                                                                                                                                                                                                                                           5m26s        1       rbd-team-alpha-sa.18a45fb480b989df
default                9m7s        Warning   RoleRefNotFound             binddefinition/bd-edge-mixed-refs                                                                              BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-746c79875-576x4                        Referenced roles not found: [ClusterRole/phantom-cluster-role ClusterRole/t-caas-security-auditor Role/tenant-alpha/phantom-namespace-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                               9m7s         1       bd-edge-mixed-refs.18a45f812d510a49
default                11m         Warning   RoleRefNotFound             binddefinition/bd-cluster-only                                                                                 BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Referenced roles not found: [ClusterRole/t-caas-security-auditor]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                         11m          2       bd-cluster-only.18a45f596fd18214
default                11m         Warning   RoleRefNotFound             binddefinition/bd-cluster-only                                                                                 BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Referenced roles not found: [ClusterRole/t-caas-security-auditor]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                         11m          1       bd-cluster-only.18a45f5970f563d2
default                9m7s        Warning   RoleRefNotFound             binddefinition/bd-cluster-only                                                                                 BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-746c79875-576x4                        Referenced roles not found: [ClusterRole/t-caas-security-auditor]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                         9m7s         1       bd-cluster-only.18a45f811cf431fd
default                9m7s        Warning   RoleRefNotFound             binddefinition/bd-cluster-only                                                                                 BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-746c79875-576x4                        Referenced roles not found: [ClusterRole/t-caas-security-auditor]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                         9m7s         1       bd-cluster-only.18a45f811db4fd70
default                11m         Warning   Deletion                    binddefinition/bd-complex-selectors                                                                            BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Deleting target resource RoleBinding/complex-selector-test-view-binding in namespace compliance-pci                                                                                                                                                                                                                                                                                                                                                                               11m          2       bd-complex-selectors.18a45f5f7c0a10c8
default                11m         Warning   Deletion                    binddefinition/bd-default-ns-test                                                                              BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Deleting target resource RoleBinding/default-ns-test-view-binding in namespace default                                                                                                                                                                                                                                                                                                                                                                                            11m          2       bd-default-ns-test.18a45f5f7e293d7f
default                11m         Warning   Deletion                    binddefinition/bd-disjoint-selectors                                                                           BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Deleting target resource RoleBinding/disjoint-selector-test-view-binding in namespace t-caas-system                                                                                                                                                                                                                                                                                                                                                                               11m          2       bd-disjoint-selectors.18a45f5f7e3e2480
default                11m         Warning   Deletion                    binddefinition/bd-edge-generated-sa                                                                            BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Deleting target resource RoleBinding/edge-generated-sa-edit-binding in namespace tenant-beta                                                                                                                                                                                                                                                                                                                                                                                      11m          1       bd-edge-generated-sa.18a45f5f8132b509
default                11m         Warning   RoleRefNotFound             binddefinition/bd-edge-missing-clusterrole                                                                     BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Referenced roles not found: [ClusterRole/nonexistent-cluster-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                        11m          2       bd-edge-missing-clusterrole.18a45f5979d98388
default                11m         Warning   RoleRefNotFound             binddefinition/bd-edge-missing-clusterrole                                                                     BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-5b6c459998-m8m59                       Referenced roles not found: [ClusterRole/nonexistent-cluster-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                        11m          2       bd-edge-missing-clusterrole.18a45f597c485bd2
default                9m7s        Warning   RoleRefNotFound             binddefinition/bd-edge-missing-clusterrole                                                                     BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-746c79875-576x4                        Referenced roles not found: [ClusterRole/nonexistent-cluster-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                        9m7s         1       bd-edge-missing-clusterrole.18a45f8126cd388c
default                8m57s       Warning   RoleRefNotFound             binddefinition/bd-edge-missing-clusterrole                                                                     BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-746c79875-576x4                        Referenced roles not found: [ClusterRole/nonexistent-cluster-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                        9m7s         2       bd-edge-missing-clusterrole.18a45f8128f33487
default                5m47s       Warning   RoleRefNotFound             binddefinition/bd-edge-missing-clusterrole                                                                     BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-57bb5c8475-fbxvm                       Referenced roles not found: [ClusterRole/nonexistent-cluster-role]. Bindings will be created but ineffective until roles exist. Will requeue with backoff.                                                                                                                                                                                                                                                                                                                        6m27s        2       bd-edge-missing-clusterrole.18a45fa67353595e
default                6m26s       Normal    Finalizer                   binddefinition/bd-edge-missing-role-policy-error-valid                                                         BindDefinitionReconciler, BindDefinitionReconciler-auth-operator-controller-manager-57bb5c8475-fbxvm                       Adding finalizer to BindDefinition bd-edge-missing-role-policy-error-valid                                                                                                           
... (truncated, 192200 chars total — see uploaded artifacts for full diff)

Copy link
Copy Markdown

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings March 11, 2026 09:29
Copy link
Copy Markdown

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

Copilot reviewed 72 out of 74 changed files in this pull request and generated 6 comments.

@MaxRink MaxRink changed the title Pr 56 feat: implement Restricted CRDs with RBACPolicy for multi-tenant RBAC governance Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 10:31
Copy link
Copy Markdown

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

Copilot reviewed 92 out of 94 changed files in this pull request and generated 9 comments.

Copilot AI review requested due to automatic review settings March 11, 2026 11:05
Copy link
Copy Markdown

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

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

Copilot reviewed 93 out of 95 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown

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

Copilot reviewed 95 out of 97 changed files in this pull request and generated 4 comments.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

📊 Output Delta Report (cont.)

📦 RestrictedRoleDefinitions Status

Changes from main
--- /dev/null	2026-04-08 11:42:44.085027028 +0000
+++ /tmp/pr-output/restrictedroledefinitions-status.yaml	2026-04-08 12:01:45.517780076 +0000
@@ -0,0 +1,376 @@
+apiVersion: v1
+items:
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: allowed
+      name: rrd-case-allowed-clusterrole
+    spec:
+      policyRef:
+        name: sample-policy-allow-all-paths
+      restrictedResources:
+        - kind: Secret
+          name: secrets
+          namespaced: true
+          singularName: secret
+          verbs:
+            - all
+      restrictedVerbs:
+        - delete
+        - escalate
+        - impersonate
+        - bind
+      scopeNamespaced: false
+      targetName: sample-cluster-reader
+      targetRole: ClusterRole
+    status:
+      conditions:
+        - message: All policy checks pass
+          reason: AllChecksPass
+          status: "True"
+          type: PolicyCompliant
+        - message: Resource is fully reconciled
+          reason: Reconciled
+          status: "True"
+          type: Ready
+      roleReconciled: true
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: blocked
+      name: rrd-case-blocked-clusterrole-by-policy
+    spec:
+      policyRef:
+        name: sample-policy-block-clusterrolebindings
+      restrictedVerbs:
+        - delete
+      scopeNamespaced: false
+      targetName: sample-clusterrole-blocked
+      targetRole: ClusterRole
+    status:
+      conditions:
+        - message: 'Policy violations detected: spec.targetRole: ClusterRoles are not allowed by policy'
+          reason: ViolationsDetected
+          status: "False"
+          type: PolicyCompliant
+        - message: deprovisioned due to policy violations
+          reason: Deprovisioned
+          status: "False"
+          type: Ready
+        - message: Controller is reconciling the resource
+          reason: Progressing
+          status: "True"
+          type: Reconciling
+      policyViolations:
+        - 'spec.targetRole: ClusterRoles are not allowed by policy'
+      roleReconciled: false
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: blocked-forbidden-verb
+      name: rrd-case-blocked-forbidden-verb-omission
+    spec:
+      policyRef:
+        name: sample-policy-allow-all-paths
+      restrictedVerbs:
+        - delete
+      scopeNamespaced: true
+      targetName: sample-blocked-forbidden-verb
+      targetNamespace: sample-tenant-a
+      targetRole: Role
+    status:
+      conditions:
+        - message: 'Policy violations detected: spec.restrictedVerbs: forbidden verb "escalate" must be listed in restrictedVerbs'
+          reason: ViolationsDetected
+          status: "False"
+          type: PolicyCompliant
+        - message: deprovisioned due to policy violations
+          reason: Deprovisioned
+          status: "False"
+          type: Ready
+        - message: Controller is reconciling the resource
+          reason: Progressing
+          status: "True"
+          type: Reconciling
+      policyViolations:
+        - 'spec.restrictedVerbs: forbidden verb "escalate" must be listed in restrictedVerbs'
+      roleReconciled: false
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: impersonated-allowed
+      name: rrd-case-impersonated-allowed
+    spec:
+      policyRef:
+        name: sample-policy-allow-all-paths
+      restrictedVerbs:
+        - escalate
+        - delete
+        - patch
+      scopeNamespaced: true
+      targetName: sample-impersonated-role
+      targetNamespace: sample-tenant-b
+      targetRole: Role
+    status:
+      conditions:
+        - message: All policy checks pass
+          reason: AllChecksPass
+          status: "True"
+          type: PolicyCompliant
+        - message: Resource is fully reconciled
+          reason: Reconciled
+          status: "True"
+          type: Ready
+      roleReconciled: true
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: impersonated-failed
+      name: rrd-case-impersonated-authz-failure
+    spec:
+      policyRef:
+        name: sample-policy-impersonation-authz-failure
+      restrictedVerbs:
+        - delete
+      scopeNamespaced: true
+      targetName: sample-impersonated-fail-role
+      targetNamespace: sample-tenant-a
+      targetRole: Role
+    status:
+      conditions:
+        - message: All policy checks pass
+          reason: AllChecksPass
+          status: "True"
+          type: PolicyCompliant
+        - message: 'Error during reconciliation: authorization denied (check operator logs for details)'
+          reason: Error
+          status: "False"
+          type: Ready
+        - message: 'Error during reconciliation: authorization denied (check operator logs for details)'
+          reason: Error
+          status: "True"
+          type: Stalled
+      roleReconciled: false
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/sample-case: partial
+      name: rrd-case-partial-filtered-rules
+    spec:
+      policyRef:
+        name: sample-policy-partially-allowed-bindings
+      restrictedApis:
+        - name: apps
+          versions:
+            - groupVersion: apps/v1
+              version: v1
+      restrictedResources:
+        - kind: Secret
+          name: secrets
+          namespaced: true
+          singularName: secret
+          verbs:
+            - all
+      restrictedVerbs:
+        - delete
+        - patch
+      scopeNamespaced: true
+      targetName: sample-partial-role
+      targetNamespace: sample-tenant-a
+      targetRole: Role
+    status:
+      conditions:
+        - message: All policy checks pass
+          reason: AllChecksPass
+          status: "True"
+          type: PolicyCompliant
+        - message: Resource is fully reconciled
+          reason: Reconciled
+          status: "True"
+          type: Ready
+      roleReconciled: true
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/tenant: cicd
+      name: rrd-ci-deploy-writer
+    spec:
+      policyRef:
+        name: cicd-pipeline-policy
+      restrictedApis:
+        - name: admissionregistration.k8s.io
+          versions:
+            - groupVersion: admissionregistration.k8s.io/v1
+              version: v1
+      restrictedResources:
+        - kind: Secret
+          name: secrets
+          namespaced: true
+          singularName: secret
+          verbs:
+            - all
+        - kind: PersistentVolume
+          name: persistentvolumes
+          namespaced: false
+          singularName: persistentvolume
+          verbs:
+            - all
+      restrictedVerbs:
+        - delete
+        - escalate
+        - impersonate
+        - bind
+      scopeNamespaced: true
+      targetName: t-caas-ci-deploy-writer
+      targetNamespace: cd-deploy
+      targetRole: Role
+    status:
+      conditions:
+        - message: 'Policy violations detected: generated rules: generated role has 92 rules, exceeding maximum of 10'
+          reason: ViolationsDetected
+          status: "False"
+          type: PolicyCompliant
+        - message: deprovisioned due to policy violations
+          reason: Deprovisioned
+          status: "False"
+          type: Ready
+        - message: Controller is reconciling the resource
+          reason: Progressing
+          status: "True"
+          type: Reconciling
+      policyViolations:
+        - 'generated rules: generated role has 92 rules, exceeding maximum of 10'
+      roleReconciled: false
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/tenant: platform-team
+      name: rrd-operator-reader
+    spec:
+      policyRef:
+        name: operator-cross-namespace-policy
+      restrictedApis:
+        - name: certificates.k8s.io
+          verbs:
+            - create
+            - update
+            - delete
+            - patch
+          versions:
+            - groupVersion: certificates.k8s.io/v1
+              version: v1
+        - name: storage.k8s.io
+      restrictedVerbs:
+        - escalate
+        - impersonate
+        - bind
+      scopeNamespaced: false
+      targetName: t-caas-operator-reader
+      targetRole: ClusterRole
+    status:
+      conditions:
+        - message: All policy checks pass
+          reason: AllChecksPass
+          status: "True"
+          type: PolicyCompliant
+        - message: Resource is fully reconciled
+          reason: Reconciled
+          status: "True"
+          type: Ready
+      roleReconciled: true
+  - apiVersion: authorization.t-caas.telekom.com/v1alpha1
+    kind: RestrictedRoleDefinition
+    metadata:
+      finalizers:
+        - restrictedroledefinition.authorization.t-caas.telekom.com/finalizer
+      labels:
+        app.kubernetes.io/managed-by: kustomize
+        app.kubernetes.io/name: auth-operator
+        t-caas.telekom.com/tenant: team-alpha
+      name: rrd-team-alpha-reader
+    spec:
+      policyRef:
+        name: team-workload-policy
+      restrictedApis:
+        - name: velero.io
+          versions:
+            - groupVersion: velero.io/v1
+              version: v1
+      restrictedResources:
+        - kind: Secret
+          name: secrets
+          namespaced: true
+          singularName: secret
+          verbs:
+            - all
+      restrictedVerbs:
+        - create
+        - update
+        - delete
+        - patch
+      scopeNamespaced: true
+      targetName: t-caas-team-alpha-reader
+      targetNamespace: team-alpha
+      targetRole: Role
+    status:
+      conditions:
+        - message: 'Policy violations detected: spec.restrictedVerbs: forbidden verb "escalate" must be listed in restrictedVerbs; spec.restrictedVerbs: forbidden verb "impersonate" must be listed in restrictedVerbs; spec.restrictedVerbs: forbidden verb "bind" must be listed in restrictedVerbs; spec.restrictedApis: forbidden API group "certificates.k8s.io" must be listed in restrictedApis; spec.restrictedResources: forbidden resource "nodes" must be listed in restrictedResources'
+          reason: ViolationsDetected
+          status: "False"
+          type: PolicyCompliant
+        - message: deprovisioned due to policy violations
+          reason: Deprovisioned
+          status: "False"
+          type: Ready
+        - message: Controller is reconciling the resource
+          reason: Progressing
+          status: "True"
+          type: Reconciling
+      policyViolations:
+        - 'spec.restrictedVerbs: forbidden verb "escalate" must be listed in restrictedVerbs'
+        - 'spec.restrictedVerbs: forbidden verb "impersonate" must be listed in restrictedVerbs'
+        - 'spec.restrictedVerbs: forbidden verb "bind" must be listed in restrictedVerbs'
+        - 'spec.restrictedApis: forbidden API group "certificates.k8s.io" must be listed in restrictedApis'
+        - 'spec.restrictedResources: forbidden resource "nodes" must be listed in restrictedResources'
+      roleReconciled: false
+kind: List

MaxRink added a commit that referenced this pull request Mar 30, 2026
- Return empty slice instead of nil from EvaluateRoleDefinition when no limits
- Use DefinitionClusterRole constant instead of string literal
- Handle wildcard '*' in restrictedVerbs via containsStringOrWildcard helper
- Fix format string bug in restricted_helpers.go: pass joined string to MarkFalse
- Use policy.ViolationStrings() to eliminate duplicate string conversion
- Add generic ReadyCondition constant, deprecate WebhookAuthorizerReadyCondition
- Update restricted CRD tests to use ReadyCondition
- Update role_evaluator_test to use constants and add wildcard test case
- Improve validateConcurrency to include flag names in error messages
- Fix misleading comments in webhook, e2e tests, and debug report
Copy link
Copy Markdown

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

Copilot reviewed 110 out of 158 changed files in this pull request and generated 3 comments.

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • BindDefinitionStatusFrom now explicitly initializes some list fields (GeneratedServiceAccounts, ExternalServiceAccounts) to ensure SSA can clear previously-populated lists, but MissingRoleRefs is not initialized. If MissingRoleRefs was previously non-empty and later becomes empty, SSA will likely not clear it because the field will be omitted (nil) from the apply payload. Fix by initializing result.MissingRoleRefs to an empty slice (capacity len(status.MissingRoleRefs)) before appending, consistent with the RestrictedBindDefinitionStatusFrom pattern.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • BindDefinitionStatusFrom now ensures SSA can clear generatedServiceAccounts and externalServiceAccounts, but it does not do the same for missingRoleRefs. If MissingRoleRefs was previously populated and later becomes empty, the field may be omitted from the apply payload and never cleared. Initialise result.MissingRoleRefs to an empty slice (even when zero-length) before appending, consistent with the other list fields.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

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

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • MissingRoleRefs is not initialised to an empty slice when it’s empty, so SSA may not clear a previously-populated status.missingRoleRefs list (it will remain on the object if the field is omitted). To make list-clearing consistent with the new behavior for GeneratedServiceAccounts/ExternalServiceAccounts, initialise result.MissingRoleRefs to an empty slice before appending (same pattern used later for RestrictedBindDefinitionStatusFrom).
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

REUSE.toml:1

  • Narrowing markdown coverage from docs/**/*.md to a few specific subpaths can unintentionally exclude existing or future markdown under other docs/ subdirectories from REUSE checks (leading to compliance failures or unmanaged license metadata). If the intent is “all docs markdown except proposals”, consider restoring a broader glob (e.g. docs/**/*.md) with explicit exclusions, or add any other docs subfolders that exist in this repo.
# SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

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

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • BindDefinitionStatusFrom initializes some slices to empty to allow SSA to clear previously-set values, but it does not do this for MissingRoleRefs. If MissingRoleRefs was previously non-empty and later becomes empty, SSA will omit the field and the old values may persist (and/or cause repeated status apply attempts). Initialize result.MissingRoleRefs to an empty slice (even when len==0) before appending, similar to GeneratedServiceAccounts/ExternalServiceAccounts.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • MissingRoleRefs is not initialized to an empty slice before appending. With SSA, omitting the field when the list becomes empty can prevent clearing a previously populated status.missingRoleRefs array, leaving stale status visible to users. Align this with the approach used for GeneratedServiceAccounts/ExternalServiceAccounts by initializing result.MissingRoleRefs = make([]string, 0, len(status.MissingRoleRefs)) before the loop so SSA can clear the field.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

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

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • BindDefinitionStatusFrom now initializes some slice fields (GeneratedServiceAccounts, ExternalServiceAccounts) to empty to ensure SSA can clear previously-populated arrays, but MissingRoleRefs is still only set when non-empty. With SSA, omitting the field can leave stale values behind. Initialize result.MissingRoleRefs to an empty slice (even when status.MissingRoleRefs is empty) before appending, mirroring the other list fields.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 5 comments.

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

api/authorization/v1alpha1/applyconfiguration/ssa/ssa.go:1

  • BindDefinitionStatusFrom initializes some list fields to an empty slice to allow SSA to clear previously-populated values, but MissingRoleRefs is not initialized. If MissingRoleRefs transitions from non-empty to empty, SSA may not clear the old list and status can remain stale. Initialize result.MissingRoleRefs to an empty slice (capacity len(status.MissingRoleRefs)) before appending, consistent with the other list fields.
// SPDX-FileCopyrightText: 2026 Deutsche Telekom AG

Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 2 comments.

MaxRink and others added 8 commits April 8, 2026 12:24
… governance

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Use %v (not %s) for client.ObjectKey in error format to render correctly
- Add nil check after impersonated client factory call to prevent type assertion panic on (nil, nil)
- Use listErrorToAdmission() in RestrictedRoleDefinition webhook for consistent transient error handling
- Return NewInvalid with field.ErrorList for duplicate targetName in RoleDefinition webhook (machine-parseable, consistent with immutability errors)
- Update test assertion to match NewInvalid response format
…ions

Remove dead RBACPolicyFinalizer constant and unused UnifiedSelector type.
Add TODO comment on AppliesTo enforcement scope and design comment on
MarkReady eventual consistency.
Enables manual triggering of CI and Output Delta workflows, useful for
re-running checks when pull_request events don't fire on force-pushes.
- listErrorToAdmission: treat context.DeadlineExceeded/Canceled as transient
  so webhook timeouts produce a consistent 'please retry' signal
- RoleDefinition webhook: add client.Limit(2) to duplicate targetName List calls
  to cap latency in multi-tenant setups
- validateNoDuplicateRestrictedAPIs/RRDAPIs: replace NewBadRequest with
  NewInvalid+field.Duplicate to give clients precise field-path error output
- validatePolicyRefExists: replace NewBadRequest with NewInvalid+field.NotFound
  targeting spec.policyRef.name for structured field-path errors
- roleTargetCollision: reword comment to make the pre-filter precondition explicit
- RestrictedBindDefinitionSpec.TargetName: fix format example to remove '/'
  which is not a valid Kubernetes object name character
Copy link
Copy Markdown

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

Copilot reviewed 110 out of 159 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown

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

Copilot reviewed 114 out of 163 changed files in this pull request and generated 3 comments.

Comment on lines +39 to +42
// ValidateCreate implements admission.Validator for RestrictedRoleDefinition.
func (v *RestrictedRoleDefinitionValidator) ValidateCreate(ctx context.Context, obj *RestrictedRoleDefinition) (admission.Warnings, error) {
ctx, cancel := context.WithTimeout(ctx, WebhookCacheTimeout)
defer cancel()
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This introduces substantial new admission behavior (policyRef existence checks, cross-type targetName collision detection, immutability enforcement, duplicate restrictedApis rejection, and version-format validation), but no dedicated webhook tests for RestrictedRoleDefinition are shown in this PR. Please add envtest/Ginkgo webhook tests similar to roledefinition_webhook_test.go to cover: (1) targetName collisions within RestrictedRoleDefinition, (2) collisions with RoleDefinition, (3) policyRef not found, (4) immutability on update (targetRole/targetName/targetNamespace/policyRef), (5) duplicate restrictedApis group names, and (6) invalid restrictedApis version strings.

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +54
// Verify that the referenced RBACPolicy exists.
if err := v.validatePolicyRefExists(ctx, obj); err != nil {
return nil, err
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This introduces substantial new admission behavior (policyRef existence checks, cross-type targetName collision detection, immutability enforcement, duplicate restrictedApis rejection, and version-format validation), but no dedicated webhook tests for RestrictedRoleDefinition are shown in this PR. Please add envtest/Ginkgo webhook tests similar to roledefinition_webhook_test.go to cover: (1) targetName collisions within RestrictedRoleDefinition, (2) collisions with RoleDefinition, (3) policyRef not found, (4) immutability on update (targetRole/targetName/targetNamespace/policyRef), (5) duplicate restrictedApis group names, and (6) invalid restrictedApis version strings.

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +79
// Enforce immutability of targetRole, targetName, targetNamespace, and policyRef.
var allErrs field.ErrorList
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This introduces substantial new admission behavior (policyRef existence checks, cross-type targetName collision detection, immutability enforcement, duplicate restrictedApis rejection, and version-format validation), but no dedicated webhook tests for RestrictedRoleDefinition are shown in this PR. Please add envtest/Ginkgo webhook tests similar to roledefinition_webhook_test.go to cover: (1) targetName collisions within RestrictedRoleDefinition, (2) collisions with RoleDefinition, (3) policyRef not found, (4) immutability on update (targetRole/targetName/targetNamespace/policyRef), (5) duplicate restrictedApis group names, and (6) invalid restrictedApis version strings.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants