User Story
As a platform operator, I want invalid CRD resources to be rejected at apply time by kubectl, so that misconfigured resources never reach the controller.
Description
Currently none of the repo-guard CRD types (GithubOrganization, GithubTeam, GithubTeamRepository, Github, LDAPGroupProvider, GenericExternalMemberProvider, etc.) have +kubebuilder validation markers. There is no admission webhook in place either. As a result, resources with empty required fields, invalid permission values, or malformed URLs are admitted silently and only fail during reconciliation with hard-to-debug errors.
Adding +kubebuilder markers to the _types.go files causes make manifests to embed OpenAPI validation into the generated CRD schemas, enabling client-side validation via kubectl and server-side validation via the Kubernetes API server — no webhook required.
This is tracked as Pillar 3 of epic #95. This issue covers the marker additions only.
Acceptance Criteria
Reference Issues
Epic: #95
User Story
Description
Currently none of the repo-guard CRD types (
GithubOrganization,GithubTeam,GithubTeamRepository,Github,LDAPGroupProvider,GenericExternalMemberProvider, etc.) have+kubebuildervalidation markers. There is no admission webhook in place either. As a result, resources with empty required fields, invalid permission values, or malformed URLs are admitted silently and only fail during reconciliation with hard-to-debug errors.Adding
+kubebuildermarkers to the_types.gofiles causesmake manifeststo embed OpenAPI validation into the generated CRD schemas, enabling client-side validation viakubectland server-side validation via the Kubernetes API server — no webhook required.This is tracked as Pillar 3 of epic #95. This issue covers the marker additions only.
Acceptance Criteria
+kubebuilder:validation:MinLength=1added to all required string fields (spec.github,spec.organization,spec.team, etc.)+kubebuilder:validation:Minimum=1added tospec.installationIDonGithubOrganization+kubebuilder:validation:Enum=admin;push;pull;maintain;triageadded to all permission fields+kubebuilder:validation:Pattern=^https?://added to URL fields onGithubandGenericExternalMemberProviderspec.organizationimmutability enforced via+kubebuilder:validation:XValidationCELoldSelfrulemake manifestsregenerates CRDs cleanly with new constraintsReference Issues
Epic: #95