Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix convert transforms toType field validation #4825

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

ravilr
Copy link
Contributor

@ravilr ravilr commented Oct 17, 2023

Description of your changes

Updates the toType enum validation to include array instead of list. the docs PR crossplane/docs#541 already captures it as array.

On the xp master and v1.13.2-up.2 release currently, kubectl apply'ing a composition with transforms[].convert.toType set to array results in validation error:

the Composition "compose-v1alpha1.example.com" is invalid: 
* spec.resources[1].patches[3].transforms[0].convert.toType: Unsupported value: "array": supported values: "string", "int", "int64", "bool", "float64", "object", "list"

trying to apply with list also results in validation error:

The Composition "compose-v1alpha1.example.com" is invalid: 
* spec.resources[1].patches[3].transforms[0].convert.toType: Invalid value: "list": invalid type

With this change, a transforms[].convert.toType set to array, applies fine.

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Added or updated unit tests.
  • Added or updated e2e tests, if necessary. (check with reviewers/maintainers if you're unsure whether E2E tests are necessary for the change).
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, if necessary.
  • Opened a PR updating the docs, if necessary.

Signed-off-by: rladdukodiraghav <rladdukodiraghav@apple.com>
@ravilr ravilr requested review from turkenh and a team as code owners October 17, 2023 15:33
@ravilr ravilr requested a review from jbw976 October 17, 2023 15:33
@ravilr
Copy link
Contributor Author

ravilr commented Oct 17, 2023

cc @phisco since you responded to this in the crossplane slack general channel. 🙏

Copy link
Contributor

@phisco phisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks @ravilr!

@phisco phisco merged commit b4396d7 into crossplane:master Oct 17, 2023
14 of 18 checks passed
@ravilr ravilr deleted the fix_transforms_validation branch October 17, 2023 18:00
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.

None yet

2 participants