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

Ensure conditional validation has knowledge of old and new object #73774

Merged
merged 2 commits into from
Feb 7, 2019

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Feb 6, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Moves conditional validation to methods with knowledge of the old and new object, to ensure we never fail an object based on a validation check of data which is already in the existing persisted object.

This ensures that once the SCTP feature is enabled, rollback of one version is safe (API validation-wise).

Which issue(s) this PR fixes:
Finishes #72651

Does this PR introduce a user-facing change?:

NONE

/sig api-machinery
/cc @sbezverk

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 6, 2019
@liggitt liggitt added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 6, 2019
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 6, 2019
Copy link
Contributor

@sbezverk sbezverk left a comment

Choose a reason for hiding this comment

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

I need just 1 clarification, other than that looks good.

return fields
}

// ValidateConditionalPodTemplate validates conditionally valid fields.
Copy link
Contributor

Choose a reason for hiding this comment

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

I could not find Unit tests for ValidateConditionalPodTemplate any particular reason it does not need one?

Copy link
Member Author

Choose a reason for hiding this comment

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

both ValidateConditionalPodTemplate and ValidateConditionalPod route to validateConditionalPodSpec, where the validation logic lives, so I just added tests for the latter.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

@sbezverk
Copy link
Contributor

sbezverk commented Feb 6, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, sbezverk

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

@k8s-ci-robot k8s-ci-robot merged commit 152b09a into kubernetes:master Feb 7, 2019
@liggitt liggitt deleted the SCTPSupport branch February 7, 2019 15:40
@danwinship danwinship mentioned this pull request Aug 12, 2020
27 tasks
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants