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

Update API version to v1beta3 #1127

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

Conversation

akrejcir
Copy link
Collaborator

What this PR does / why we need it:

Which issue(s) this PR fixes:
The new API version removes feature gates and unused parameters. It is directly compatible with the old version, so a conversion webhook is not needed.

The stored version is still set to v1beta2, and ssp-operator watches this old version. In a next release we may switch to using the v1beta3 as the stored version.

Fixes: https://issues.redhat.com/browse/CNV-44976

Release note:

Added new API version v1beta3.

The version v1beta2 was introduced in v0.18.0.
Users probably have updated to this API version by now.

Signed-off-by: Andrej Krejcir <[email protected]>
- Added unit tests for template validator placement check in webhook.
- Improved webhook unit test code to make it simpler to read and extend.

Signed-off-by: Andrej Krejcir <[email protected]>
@kubevirt-bot kubevirt-bot added 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 DCO signed all their commits. labels Nov 12, 2024
@kubevirt-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 ask for approval from akrejcir. 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

@akrejcir
Copy link
Collaborator Author

/cc @0xFelix @jcanocan @codingben

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

Do we want to hold this back until the next release? Or do we want to switch to v1beta3 in the next release?

docs/configuration.md Outdated Show resolved Hide resolved
@@ -471,6 +470,13 @@ func getSsp() *sspv1beta2.SSP {
return foundSsp
}

func getSspV1Beta3() *sspv1beta3.SSP {
Copy link
Member

Choose a reason for hiding this comment

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

Can we already switch to v1beta3 by default in tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's not do it yet. We can do it in 4.19.

Copy link
Member

Choose a reason for hiding this comment

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

Can this be auto-generated?

Copy link
Collaborator Author

@akrejcir akrejcir Nov 12, 2024

Choose a reason for hiding this comment

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

Kubevirt uses https://pkg.go.dev/k8s.io/code-generator/cmd/conversion-gen . We can add it in a later PR. But currently we only have these few functions, so it may not be worth introducing an external tool.

@akrejcir
Copy link
Collaborator Author

Do we want to hold this back until the next release? Or do we want to switch to v1beta3 in the next release?

I'm not sure I understand your question. Both versions will be available for a few releases. This PR should go to 4.18.

webhooks/ssp_webhook.go Outdated Show resolved Hide resolved
The new API version removes feature gates and unused
parameters. It is directly compatible with the old version,
so a conversion webhook is not needed.

The stored version is still set to v1beta2, and ssp-operator
watches this old version. In a next release we may switch
to using the v1beta3 as stored version.

Signed-off-by: Andrej Krejcir <[email protected]>
Updated docs/configuration.md to use new API version,
and removed section about feature gates.

Signed-off-by: Andrej Krejcir <[email protected]>
Copy link

sonarcloud bot commented Nov 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
39.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Member

@codingben codingben left a comment

Choose a reason for hiding this comment

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

/lgtm

@akrejcir How often we do such API bump? Is it done because of TokenGenerationService?

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 13, 2024
@akrejcir
Copy link
Collaborator Author

/lgtm

@akrejcir How often we do such API bump? Is it done because of TokenGenerationService?

Rarely, only when we want to do some incompatible change.
This PR is because we wanted to remove feature gates: https://issues.redhat.com/browse/CNV-44976

Copy link

openshift-ci bot commented Nov 13, 2024

@akrejcir: 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
ci/prow/e2e-single-node-functests 97595a7 link true /test e2e-single-node-functests

Full PR test history. Your PR dashboard.

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-sigs/prow 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
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants