8000 Add apiextensions.k8s.io/v1 CRDs by meyskens · Pull Request #3178 · cert-manager/cert-manager · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add apiextensions.k8s.io/v1 CRDs #3178

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

Merged
merged 13 commits into from
Aug 17, 2020
Merged

Conversation

meyskens
Copy link
Contributor

What this PR does / why we need it:
This adds v1 CRDs to use in Kubernetes 1.16, the legacy release will have the v1beta1 version.
Both are being created and updated by controller-gen

Which issue this PR fixes:
fixes #2953

Special notes for your reviewer:
Webhook still only has v1beta1 conversion support.
Pending on changes off #3167

/hold for this to be merged and v1 conversions to be added

Also should be rebased after #3177 merges

Release note:

Add apiextensions.k8s.io/v1 CRDs

/kind cleanup

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Aug 13, 2020
@jetstack-bot jetstack-bot requested a review from munnerz August 13, 2020 13:15
@jetstack-bot jetstack-bot added area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 13, 2020
@meyskens meyskens added this to the v1.0 milestone Aug 13, 2020
@@ -24,6 +24,7 @@ import (

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needs to change when v1 is merged in
We never added this before but it breaks controller-gen when not in patching mode which is handy to run for like euh... generating a new version :D

@jetstack-bot jetstack-bot added the area/testing Issues relating to testing label Aug 13, 2020
@meyskens meyskens force-pushed the crd-v1 branch 2 times, most recently from 8a03db1 to cfbe9fc Compare August 13, 2020 15:13
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Run update

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Add back helm things

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Let bazel handle the both types

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Add back additionalPrinterColumns

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Add subresources: status: {}

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

re-add short names

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Update conversion

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

fix deploy

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
@meyskens
Copy link
Contributor Author

/unhold

@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 14, 2020
Copy link
Member
@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

  • Are the deploy/tmp/* files meant to be committed? Or are they accidentally committed build artifacts?

return review, nil

versionedOutput, err := defaultScheme.ConvertToVersion(review, outputVersion)
return versionedOutput, err
Copy link
Member

Choose a reason for hiding this comment

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

Why did this function change so much? Is this the function that converts cmapi resources between versions?
The original never called defaultScheme.ConvertToVersion, so how did it used to work?

Also it looks like the function now supports both v1beta1 and v1 apiextensions, but should we use a type switch to catch those two expected versions and default with a returned error to catch anything else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does not convert them, it passes the conversion API request to the code that actually handles the conversion. In the past the Kubernetes API could only send a request of type v1beta1. Now it can send both, v1beta1 in legacy installs and v1 in "mainline" installs. Thus the need for us to convert the requests and responses when replying ot k8s.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Type switches I think won't work here as the input is a runtime.Object, but I added a better error

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Thanks for explaining.

@wallrj
Copy link
Member
wallrj commented Aug 14, 2020

/test pull-cert-manager-e2e-v1-19
/test pull-cert-manager-e2e-v1-17
/test pull-cert-manager-e2e-v1-16
/test pull-cert-manager-e2e-v1-15
/test pull-cert-manager-e2e-v1-14
/test pull-cert-manager-e2e-v1-13
/test pull-cert-manager-e2e-v1-12
/test pull-cert-manager-e2e-v1-11

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
@meyskens
Copy link
Contributor Author

/test pull-cert-manager-e2e-v1-15

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
@meyskens
Copy link
Contributor Author

/test pull-cert-manager-e2e-v1-15

Copy link
Member
@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -17,7 +17,7 @@ modify_file(
name = "crds.legacy",
src = "//deploy/crds:templates.legacy",
out = "crds.legacy.yaml",
prefix = """{{- if (semverCompare "<1.15-0" .Capabilities.KubeVersion.GitVersion) }}
prefix = """{{- if (semverCompare "<1.16-0" .Capabilities.KubeVersion.GitVersion) }}
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a more descriptive release note, explaining the new installation yaml for 1.15 users....or will that be done in a separate upgrading section of the release notes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a very big release note :) will prepare that PR this week so we have it in time for beta.0

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2020
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: meyskens, wallrj

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

@jetstack-bot jetstack-bot merged commit ae6a747 into cert-manager:master Aug 17, 2020
@meyskens meyskens deleted the crd-v1 branch August 17, 2020 10:20
@@ -28,7 +28,7 @@ import (
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
apiextensionsinstall "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Copy link
Contributor

Choose a reason for hiding this comment

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

😢

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. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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 Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update CRDs to v1
4 participants
0