Skip to content

Fix kubebuilder enum for StringTransformType: add Join and Replace#296

Closed
StuporHero wants to merge 1 commit intocrossplane-contrib:mainfrom
StuporHero:fix-string-transform-enum-schema
Closed

Fix kubebuilder enum for StringTransformType: add Join and Replace#296
StuporHero wants to merge 1 commit intocrossplane-contrib:mainfrom
StuporHero:fix-string-transform-enum-schema

Conversation

@StuporHero
Copy link

Description

The Join string transform type was added in v0.7.0 (#133) and Replace was added later, but the kubebuilder validation enum marker on StringTransform.Type was not updated to include them. This causes the generated CRD schema to reject valid Compositions that use these transform types.

The Go code correctly defines the constants:

StringTransformTypeJoin    StringTransformType = "Join"
StringTransformTypeReplace StringTransformType = "Replace"

But the marker only lists:

// +kubebuilder:validation:Enum=Format;Convert;TrimPrefix;TrimSuffix;Regexp

Changes

  • Updated the kubebuilder enum marker to include Join and Replace
  • Regenerated the CRD via go generate ./input/...

How was this change tested?

CRD regeneration via go generate — the updated CRD now includes Join and Replace in all string transform type enums.

The Join string transform type was added in v0.7.0 (crossplane-contrib#133) and Replace
was added later, but the kubebuilder validation enum marker on
StringTransform.Type was not updated to include them. This causes CRD
schema validation to reject valid Compositions using these transform
types.

Signed-off-by: Michael Juliano <michaelj@sunsofterp.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@StuporHero StuporHero force-pushed the fix-string-transform-enum-schema branch from 1130e8e to fbdf1d2 Compare March 6, 2026 19:06
@StuporHero StuporHero closed this Mar 6, 2026
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.

1 participant