Skip to content

apiextensions: allow "required" at root with status subresource#63533

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
sttts:sttts-required-with-status-subresource
May 9, 2018
Merged

apiextensions: allow "required" at root with status subresource#63533
k8s-github-robot merged 1 commit intokubernetes:masterfrom
sttts:sttts-required-with-status-subresource

Conversation

@sttts
Copy link
Copy Markdown
Contributor

@sttts sttts commented May 8, 2018

In the subresources alpha we intentionally disallowed anything than properties at the root of the validation schema in order to allow us to project it to the .status subtree. By doing this we also disallowed required at the root which is necessary to enforce e.g. a spec to be set. This PR fixes this.

Moreover, it fixes that the restriction is only enforced when the status subresource is actually enabled. Before this PR we were enforcing the restriction as soon as the feature gate was enabled, leading to a backwards incompatible change.

Allow "required" and "description" to be used at the CRD OpenAPI validation schema root when the /status subresource is enabled.

There was an issue reporting the bug. But cannot find it.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 8, 2018
@k8s-ci-robot k8s-ci-robot requested review from deads2k and enisoc May 8, 2018 08:50
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 8, 2018
@xmudrii
Copy link
Copy Markdown
Member

xmudrii commented May 8, 2018

LGTM.

@sttts sttts force-pushed the sttts-required-with-status-subresource branch from ed0f9f9 to 270b5c6 Compare May 8, 2018 09:10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we are only allowing this for status, I think the error message should be something like "if status subresource is enabled..."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@nikhita
Copy link
Copy Markdown
Member

nikhita commented May 9, 2018

There is an integration test which checks that nothing other than properties should be present at the root, this is failing now. I guess we can remove that test.

Apart from these, lgtm. 👍

@sttts sttts force-pushed the sttts-required-with-status-subresource branch from 270b5c6 to a9db48d Compare May 9, 2018 07:40
@sttts
Copy link
Copy Markdown
Contributor Author

sttts commented May 9, 2018

Test fixed.

@sttts
Copy link
Copy Markdown
Contributor Author

sttts commented May 9, 2018

Volume flake.

/retest

@sttts sttts force-pushed the sttts-required-with-status-subresource branch from a9db48d to 1558da1 Compare May 9, 2018 08:25
@sttts
Copy link
Copy Markdown
Contributor Author

sttts commented May 9, 2018

/retest
/lgtm

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@sttts: you cannot LGTM your own PR.

Details

In response to this:

/retest
/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
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

The pull request process is described here

Details 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

@sttts sttts added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2018
@k8s-github-robot
Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 59034, 63565, 63533). If you want to cherry-pick this change to another branch, please follow the instructions here.

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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants