Skip to content

Extend apis.kcp.io/v1alpha2 with APIBinding #3384

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Apr 25, 2025

Summary

This PR extends the apis.kcp.io/v1alpha2 with APIBindings and related types. This new version is a 1:1 copy of the current v1alpha1 API at the moment. The new v1alpha2 version will be changed after this PR is merged (to make this PR easier to review) as part of implementing #3255

All the code was updated to refer to v1alpha2.APIBindings.

#3318 has been used as the inspiration for this PR.

What Type of PR Is This?

/kind feature

Related Issue(s)

None

Release Notes

Extended `apis.kcp.io/v1alpha2` with `APIBinding`

@kcp-ci-bot kcp-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. area/cli Issues or PRs related to CLI changes kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Apr 25, 2025
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sttts for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@kcp-ci-bot kcp-ci-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 25, 2025
@xmudrii xmudrii force-pushed the apibindings-v1beta2 branch 3 times, most recently from 6818042 to b564d60 Compare April 25, 2025 17:53
@xmudrii xmudrii changed the title [WIP] Extend apis.kcp.io/v1alpha2 with APIBinding Extend apis.kcp.io/v1alpha2 with APIBinding Apr 25, 2025
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 25, 2025
@sttts
Copy link
Member

sttts commented Apr 25, 2025

Sgtm.

@@ -429,6 +431,420 @@ spec:
- spec
type: object
served: true
storage: false
Copy link
Member

Choose a reason for hiding this comment

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

we are breaking rollback with this

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttts I believe this is coming from:

// +kubebuilder:storageversion

I took that from APIExports v1alpha2:

// +kubebuilder:storageversion

I don't know if this is needed for APIExports and not needed for APIBindings, but my thought was to stay consistent. Given that, this would break rollback for APIExports too, right?

Do you have any alternative idea what to do about this?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttts I discussed this with @xrstf (since he did the APIExports/v1alpha2 implementation) and came to the following realisation. I think the idea here is that we might change this API in the backwards incompatible way especially in the development phase (i.e. until the v0.27.0 release). Making such changes while the version is the storage version means it could break reading from the etcd, as the API server could run into fields and types that it can't recognize. And implementing a migration mechanism for that case specifically sounds like lots of work, especially that we already have conversion from v1alpha1 to v1alpha2.

That said, I think the idea is that the previous version should be the storage version at least until just before the release or until we're confident into the new API. In this case, both APIBindings and APIExports should use v1alpha1 as the storage version.

Did I get this correctly?

@sttts
Copy link
Member

sttts commented Apr 27, 2025

While in general this looks good, the timing is questionable. Why don't we first get the API in place properly with the fields we want, and AFTER that do the "now everything will use it" PR ? Seems to be much more natural rather than having a limbo phase where the version is not ready, but already used.

@mjudeikis
Copy link
Contributor

While in general this looks good, the timing is questionable. Why don't we first get the API in place properly with the fields we want, and AFTER that do the "now everything will use it" PR ? Seems to be much more natural rather than having a limbo phase where the version is not ready, but already used.

I think the bot works IF we can get the next PR "chained to this PR " and merge them together. Would want to see "implementation" first before start merging.

@xmudrii
Copy link
Member Author

xmudrii commented May 6, 2025

While in general this looks good, the timing is questionable. Why don't we first get the API in place properly with the fields we want, and AFTER that do the "now everything will use it" PR ? Seems to be much more natural rather than having a limbo phase where the version is not ready, but already used.

I'm fine with that, I'm already working on applying the implementation to v1alpha2 and I'll do as @mjudeikis proposed.

@xmudrii
Copy link
Member Author

xmudrii commented May 9, 2025

@sttts @mjudeikis I created #3402 based on this PR with implementation for #3255. The PR is in the WIP state because I'm yet to add some more tests, but other than that, the implementation is complete and ready for review.

@xmudrii xmudrii force-pushed the apibindings-v1beta2 branch from b564d60 to d1c4645 Compare May 9, 2025 22:52
@xmudrii
Copy link
Member Author

xmudrii commented May 10, 2025

/retest

@kcp-ci-bot
Copy link
Contributor

@xmudrii: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kcp-test-e2e-multiple-runs fe73019 link true /test pull-kcp-test-e2e-multiple-runs

Full PR test history

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Issues or PRs related to CLI changes dco-signoff: yes Indicates the PR's author has signed the DCO. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants