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

CRD supports multi-version Schema #67553

Open
wants to merge 4 commits into
base: master
from

Conversation

@roycaihw
Member

roycaihw commented Aug 18, 2018

What this PR does / why we need it:
Part of the CRD conversion webhook KEP: kubernetes/community#2420

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

CRD supports multi-version Schema
@k8s-ci-robot

This comment has been minimized.

Show comment
Hide comment
@k8s-ci-robot

k8s-ci-robot Aug 23, 2018

Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: roycaihw
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

Contributor

k8s-ci-robot commented Aug 23, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: roycaihw
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

@roycaihw

This comment has been minimized.

Show comment
Hide comment
@roycaihw

roycaihw Aug 24, 2018

Member

/retest

cc @sttts @nikhita

Member

roycaihw commented Aug 24, 2018

/retest

cc @sttts @nikhita

@roycaihw

This comment has been minimized.

Show comment
Hide comment
@roycaihw

roycaihw Aug 24, 2018

Member

@mbohlool @sttts I think I don't have permission to add milestone labels. Could you add this PR to 1.12 milestone? Thanks!

Member

roycaihw commented Aug 24, 2018

@mbohlool @sttts I think I don't have permission to add milestone labels. Could you add this PR to 1.12 milestone? Thanks!

@sttts sttts added this to the v1.12 milestone Aug 27, 2018

@roycaihw

This comment has been minimized.

Show comment
Hide comment
@roycaihw

roycaihw Aug 27, 2018

Member

@sttts @mbohlool This PR is ready for another round of review. PTAL :)

Member

roycaihw commented Aug 27, 2018

@sttts @mbohlool This PR is ready for another round of review. PTAL :)

@@ -322,6 +339,7 @@ func TestScaleSubresource(t *testing.T) {
}
func TestValidationSchemaWithStatus(t *testing.T) {
defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)()

This comment has been minimized.

@mbohlool

mbohlool Aug 28, 2018

Member

nit: Not sure if this pattern is common in the test code (ignore if it is), but I think it is better to do something like

featureCleanup := utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)
defer featureCleanup()
@mbohlool

mbohlool Aug 28, 2018

Member

nit: Not sure if this pattern is common in the test code (ignore if it is), but I think it is better to do something like

featureCleanup := utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)
defer featureCleanup()

This comment has been minimized.

@roycaihw

roycaihw Aug 29, 2018

Member

Searched in our code base and this is the majority pattern where SetFeatureGateDuringTest is used, although there isn't a lot of usage of this function (~20)

@roycaihw

roycaihw Aug 29, 2018

Member

Searched in our code base and this is the majority pattern where SetFeatureGateDuringTest is used, although there isn't a lot of usage of this function (~20)

This comment has been minimized.

@mbohlool

mbohlool Aug 29, 2018

Member

That is fine then.

@mbohlool

mbohlool Aug 29, 2018

Member

That is fine then.

@roycaihw

This comment has been minimized.

Show comment
Hide comment
@roycaihw

roycaihw Sep 4, 2018

Member

Updated this PR following the discussion in #67521.

Currently what's in this PR:

  • We feature gate validation: on creation, and on updating a CRD that didn't have per-version fields set
  • We only do logical default
  • We allow setting version[0].schema to override global schema for the first version
Member

roycaihw commented Sep 4, 2018

Updated this PR following the discussion in #67521.

Currently what's in this PR:

  • We feature gate validation: on creation, and on updating a CRD that didn't have per-version fields set
  • We only do logical default
  • We allow setting version[0].schema to override global schema for the first version
@roycaihw

This comment has been minimized.

Show comment
Hide comment
@roycaihw

roycaihw Sep 5, 2018

Member

/retest

Member

roycaihw commented Sep 5, 2018

/retest

@mbohlool mbohlool modified the milestones: v1.12, v1.13 Sep 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment