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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix crd flattening for structType marker to not create duplicate entries for XMapType #697

Merged

Conversation

chrischdi
Copy link
Member

Bug was introduced in #693.

As outlined in #693 (comment) , #693 introduced the bug that x-kubernetes-map-type may now get set twice and thus result in two entries in allOf.

This is because before #693 the marker at the type definition was simply ignored but now they got combined.

This PR fixes the flattening to handle this case for the structType marker.

A similar fix for the markers mapType, listType and listMapKey is not necessary because setting them where the type is referenced would result in an error anyway. Before #693 this was also the case, but since #693 it is possible to set them at the type definition.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 29, 2022
@chrischdi chrischdi changed the title 馃悰 Fix crd flattening for XMapType to not duplicate entries 馃悰 Fix crd flattening for structType marker to not create duplicate entries for XMapType Jun 29, 2022
@chrischdi
Copy link
Member Author

cc @robbie-demuth : could you give this a try?

@sbueringer
Copy link
Member

/cherry-pick release-0.9
/lgtm

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-0.9 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.9
/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2022
@FillZpp
Copy link
Contributor

FillZpp commented Jun 29, 2022

/lgtm

Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, chrischdi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2022
@k8s-ci-robot k8s-ci-robot merged commit 1878064 into kubernetes-sigs:master Jun 29, 2022
@k8s-infra-cherrypick-robot

@sbueringer: #697 failed to apply on top of branch "release-0.9":

Applying: Fix crd flattening for XMapType to not duplicate entries
Using index info to reconstruct a base tree...
M	pkg/crd/flatten.go
M	pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Falling back to patching base and 3-way merge...
Auto-merging pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Auto-merging pkg/crd/flatten.go
CONFLICT (content): Merge conflict in pkg/crd/flatten.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix crd flattening for XMapType to not duplicate entries
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.9
/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sbueringer
Copy link
Member

@chrischdi Can you please open a manual cherry-pick PR when you have some time? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants