Repository navigation
feat(components): implement platform requirements and cluster CRD rules validation - #593
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces platform-level integration rules to the compatibility matrix linter, allowing components to define Kubernetes version constraints and required CRDs. The review feedback highlights a mismatch in README.md where the documented YAML structure for platformRequirements does not align with the Go struct definition, which would cause decoding failures. Additionally, it is recommended to enhance CRD validation in matrix.go to ensure that configured CRD names adhere to the standard Kubernetes naming format.
9e74d8e to
5348b2b
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces platform-level integration rules (platformRequirements) to the linter, enabling validation of target Kubernetes versions and required CRDs for components. The changes include configuration updates, core validation logic in matrix.go, and comprehensive unit tests. A review comment suggests making the CRD name validation more robust by splitting the CRD string into segments and ensuring each segment conforms to Kubernetes DNS label rules.
5348b2b to
0bbf9a5
Compare
0bbf9a5 to
6911a31
Compare
6911a31 to
b6b51e1
Compare
b6b51e1 to
d0a5fba
Compare
d0a5fba to
0381dd2
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces platform-level integration rules and validation to the static linter engine, enabling verification of Kubernetes version constraints and required CRDs for components. The reviewer suggested enhancing the CRD validation logic to fully conform to RFC-1123 DNS subdomain and label constraints by enforcing length limits of 63 characters for individual segments and 253 characters for the total CRD name.
c2579e6 to
31396c0
Compare
5738e8c to
ccc7148
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ccc7148 to
8ececbf
Compare
8ececbf to
e8939b1
Compare
e8939b1 to
b7659bc
Compare
…es validation Introduce PlatformRequirementConfig and PlatformIntegrationRule to rules.yaml configuration, enabling validation of component Kubernetes version constraints (minK8sVersion, maxK8sVersion, kubernetesVersion) and requiredCRDs assertions. Fixes bug #548436540 TAG=agy CONV=75de09f1-5b4f-442c-991a-fcef20ac1c7d
… documentation - Update validateRequiredCRDs to validate Kubernetes CRD naming convention (<plural>.<group> with lowercase alphanumeric, '-', and '.') - Add unit tests in matrix_test.go covering requiredCRD format validation - Update README.md platformRequirements documentation to match []PlatformIntegrationRule Go struct TAG=agy BUG=548436540
Addressed review comment: - #593 (comment)
…atform rules - Enforce max total length of 253 characters for requiredCRD DNS subdomains - Enforce max segment length of 63 characters for requiredCRD DNS labels - Add unit tests covering RFC-1123 length bounds Comment link: #593 (comment) TAG=agy
…lidation functions - Document evaluatePlatformRequirements and validatePlatformRule - Document validateK8sVersions, validateK8sConstraint, and validateSingleRequiredCRD BUG=548436540 TAG=agy CONV=75de09f1-5b4f-442c-991a-fcef20ac1c7d
- Update validateK8sVersions to parse versions with semver.NewVersion - Align with Masterminds/semver/v3 adoption across linter package BUG=548436540 TAG=agy CONV=75de09f1-5b4f-442c-991a-fcef20ac1c7d
Summary
Implements Pass 3: Platform Requirements & Cluster CRD Rules for the
xmc-linterstatic validation engine. This pass validates target Kubernetes version boundaries and required Kubernetes Custom Resource Definitions (CRDs) for components specified inrules.yaml.Key Capabilities
1.28) and 3-segment (1.28.0) SemVer version bounds (minK8sVersion,maxK8sVersion,kubernetesVersion), enforcing thatminK8sVersion <= maxK8sVersion.requiredCRDsnaming format against RFC-1123 subdomain rules, enforcing maximum length <= 253 characters and segment lengths <= 63 characters.Architectural & Security Invariants
minK8sVersion > maxK8sVersion) and malformed CRD names before manifest evaluation.Verification & Validation Evidence
1. Bazel Unit & Coverage Test Matrix
bazel test //cmd/xmc-linter/... //pkg/components/linter/...(PASSED)matrix.go: 95.0%)2. Manual Testing & Live GKE Deployment Verification
...(us-central1, Kubernetesv1.35.6-gke.1710000, CRDs:jobsets.jobset.x-k8s.io,clusterqueues.kueue.x-k8s.io,components.xmc.dev) deployed via/XMC Upgrade Environment.min 1.38 > max 1.32):requiredCRDs>63 characters):BUG=548436540
TAG=agy
CONV=75de09f1-5b4f-442c-991a-fcef20ac1c7d