Implement Validation Webhook for Splunk Enterprise CRDs #1681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Thats a PR to Feature Branch
This PR implements a centralized validation webhook for all Splunk Enterprise CRDs. The webhook validates spec fields on CREATE and UPDATE operations, providing immediate feedback to users when invalid configurations are submitted.
Key Changes
New Validation Package (pkg/splunk/enterprise/validation/):
validator.go - Generic type-safe validator interface using Go generics
registry.go - Validator registry for all CRD types
validate.go - Core validation logic and AdmissionReview handling
server.go - HTTP webhook server with TLS support
common_validation.go - Shared validation functions for common spec fields
CRD-specific validators - Standalone, IndexerCluster, SearchHeadCluster, ClusterManager, LicenseManager, MonitoringConsole
Webhook Infrastructure:
config/webhook/ - Webhook service and ValidatingWebhookConfiguration manifests
config/certmanager/ - TLS certificate configuration via cert-manager
config/default/ - Kustomize patches for webhook integration
cmd/main.go - Webhook server startup integration
Testing and Verification
Unit tests for every change
Related Issues
N/A
PR Checklist