Skip to content

Comments

UPSTREAM 1324: 🐛 fix(crd): sort XValidation rules for deterministic output#33

Merged
JoelSpeed merged 1 commit intoopenshift:masterfrom
jaypoulz:strict-validation-ordering-openshift
Jan 19, 2026
Merged

UPSTREAM 1324: 🐛 fix(crd): sort XValidation rules for deterministic output#33
JoelSpeed merged 1 commit intoopenshift:masterfrom
jaypoulz:strict-validation-ordering-openshift

Conversation

@jaypoulz
Copy link

This address a 🐛 with inconsistent validation order.

XValidation rules are now sorted by message after each append to ensure consistent CRD generation across runs. Previously, markers processed from a map produced non-deterministic iteration order, causing verify checks to fail intermittently.

Generated-by: Claude Opus 4.5 (Anthropic)

@openshift-ci openshift-ci bot requested a review from JoelSpeed January 15, 2026 20:44
@jaypoulz jaypoulz force-pushed the strict-validation-ordering-openshift branch from c584af6 to 0f43f6f Compare January 15, 2026 21:03
@jaypoulz jaypoulz changed the title fix(crd): sort XValidation rules for deterministic output UPSTREAM 1324: 🐛 fix(crd): sort XValidation rules for deterministic output Jan 15, 2026
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 15, 2026
Update controller-tools to include fix for deterministic XValidation
rule ordering (PR kubernetes-sigs/controller-tools#1324). This also
bumps Go to 1.25 and k8s.io dependencies to v0.35.0.

Replace directive now points to jaypoulz/controller-tools fork with
the ordering fix until it is merged upstream. The current version
uses openshift/kubernetes-sigs-controller-tools#33
to maintain go version compatibility.

Generated-by: Claude Opus 4.5 (Anthropic)
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 16, 2026
Update controller-tools to include fix for deterministic XValidation
rule ordering (PR kubernetes-sigs/controller-tools#1324). This also
bumps Go to 1.25 and k8s.io dependencies to v0.35.0.

Replace directive now points to jaypoulz/controller-tools fork with
the ordering fix until it is merged upstream. The current version
uses openshift/kubernetes-sigs-controller-tools#33
to maintain go version compatibility.

Generated-by: Claude Opus 4.5 (Anthropic)
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 16, 2026
Update controller-tools to jaypoulz/controller-tools fork which includes
a fix for deterministic XValidation rule ordering. This ensures CRD
generation produces consistent output regardless of map iteration order.

Changes included:
- tools/go.mod: Point replace directive to jaypoulz/controller-tools
- tools/Makefile: Fix openapi-gen path (moved from code-generator to
  kube-openapi upstream)
- tools/codegen/pkg/crdify/generator.go: Ignore 'type' validation for
  allOf→enum schema simplification
- tools/codegen/pkg/schemacheck/generator.go: Disable NoDataTypeChange
  comparator for the same schema simplification

The new controller-tools generates simpler enum schemas without allOf
wrappers when both type and field have enum markers. This is functionally
equivalent but structurally different, requiring the crdify and
schemacheck adjustments to avoid false positive violations.

Upstream fix: kubernetes-sigs/controller-tools#1324
OpenShift carry: openshift/kubernetes-sigs-controller-tools#33

The OpenShift carry is a temporary backport until we can bump to Go 1.25,
which is required by the upstream controller-tools version with this fix.

Created with support from Claude Opus 4 (Anthropic)
@jaypoulz jaypoulz force-pushed the strict-validation-ordering-openshift branch from 0f43f6f to 6332311 Compare January 16, 2026 17:49
XValidation rules are sorted by Rule after each append to ensure
consistent CRD generation across runs.

Created with support from Claude Opus 4.5 (Anthropic)
@jaypoulz jaypoulz force-pushed the strict-validation-ordering-openshift branch from 6332311 to 88e61f2 Compare January 16, 2026 18:05
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 16, 2026
Update controller-tools to jaypoulz/controller-tools fork which includes
a fix for deterministic XValidation rule ordering. This ensures CRD
generation produces consistent output regardless of map iteration order.

Changes included:
- tools/go.mod: Point replace directive to jaypoulz/controller-tools
- tools/Makefile: Fix openapi-gen path (moved from code-generator to
  kube-openapi upstream)
- tools/codegen/pkg/crdify/generator.go: Ignore 'type' validation for
  allOf→enum schema simplification
- tools/codegen/pkg/schemacheck/generator.go: Disable NoDataTypeChange
  comparator for the same schema simplification

The new controller-tools generates simpler enum schemas without allOf
wrappers when both type and field have enum markers. This is functionally
equivalent but structurally different, requiring the crdify and
schemacheck adjustments to avoid false positive violations.

Upstream fix: kubernetes-sigs/controller-tools#1324
OpenShift carry: openshift/kubernetes-sigs-controller-tools#33

The OpenShift carry is a temporary backport until we can bump to Go 1.25,
which is required by the upstream controller-tools version with this fix.

Created with support from Claude Opus 4 (Anthropic)
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 16, 2026
Update controller-tools to jaypoulz/controller-tools fork which includes
a fix for deterministic XValidation rule ordering. This ensures CRD
generation produces consistent output regardless of map iteration order.

Changes included:
- tools/go.mod: Point replace directive to jaypoulz/controller-tools
- tools/Makefile: Fix openapi-gen path (moved from code-generator to
  kube-openapi upstream)
- tools/codegen/pkg/crdify/generator.go: Ignore 'type' validation for
  allOf→enum schema simplification
- tools/codegen/pkg/schemacheck/generator.go: Disable NoDataTypeChange
  comparator for the same schema simplification

The new controller-tools generates simpler enum schemas without allOf
wrappers when both type and field have enum markers. This is functionally
equivalent but structurally different, requiring the crdify and
schemacheck adjustments to avoid false positive violations.

Upstream fix: kubernetes-sigs/controller-tools#1324
OpenShift carry: openshift/kubernetes-sigs-controller-tools#33

The OpenShift carry is a temporary backport until we can bump to Go 1.25,
which is required by the upstream controller-tools version with this fix.

Created with support from Claude Opus 4 (Anthropic)
jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 16, 2026
Update controller-tools to jaypoulz/controller-tools fork which includes
a fix for deterministic XValidation rule ordering. This ensures CRD
generation produces consistent output regardless of map iteration order.

Changes included:
- tools/go.mod: Point replace directive to jaypoulz/controller-tools
- tools/Makefile: Fix openapi-gen path (moved from code-generator to
  kube-openapi upstream)
- tools/codegen/pkg/crdify/generator.go: Ignore 'type' validation for
  allOf→enum schema simplification
- tools/codegen/pkg/schemacheck/generator.go: Disable NoDataTypeChange
  comparator for the same schema simplification

The new controller-tools generates simpler enum schemas without allOf
wrappers when both type and field have enum markers. This is functionally
equivalent but structurally different, requiring the crdify and
schemacheck adjustments to avoid false positive violations.

Upstream fix: kubernetes-sigs/controller-tools#1324
OpenShift carry: openshift/kubernetes-sigs-controller-tools#33

The OpenShift carry is a temporary backport until we can bump to Go 1.25,
which is required by the upstream controller-tools version with this fix.

Created with support from Claude Opus 4 (Anthropic)
@JoelSpeed JoelSpeed merged commit 5c2ed3c into openshift:master Jan 19, 2026
@JoelSpeed
Copy link

I think I merged this permaturely

jaypoulz added a commit to jaypoulz/api that referenced this pull request Jan 19, 2026
Update controller-tools to jaypoulz/controller-tools fork which includes
a fix for deterministic XValidation rule ordering. This ensures CRD
generation produces consistent output regardless of map iteration order.

Changes included:
- tools/go.mod: Point replace directive to jaypoulz/controller-tools
- tools/Makefile: Fix openapi-gen path (moved from code-generator to
  kube-openapi upstream)
- tools/codegen/pkg/crdify/generator.go: Ignore 'type' validation for
  allOf→enum schema simplification
- tools/codegen/pkg/schemacheck/generator.go: Disable NoDataTypeChange
  comparator for the same schema simplification

The new controller-tools generates simpler enum schemas without allOf
wrappers when both type and field have enum markers. This is functionally
equivalent but structurally different, requiring the crdify and
schemacheck adjustments to avoid false positive violations.

Upstream fix: kubernetes-sigs/controller-tools#1324
OpenShift carry: openshift/kubernetes-sigs-controller-tools#33

The OpenShift carry is a temporary backport until we can bump to Go 1.25,
which is required by the upstream controller-tools version with this fix.

Created with support from Claude Opus 4 (Anthropic)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants