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

add helpers for managing conditions #92717

Merged
merged 1 commit into from Jul 9, 2020

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jul 1, 2020

adds basic find/set/remove/status for conditions

/priority important-soon
@kubernetes/sig-api-machinery-pr-reviews

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 1, 2020
@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 1, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2020
@deads2k deads2k changed the title [wip] add helpers for managing conditions add helpers for managing conditions Jul 1, 2020
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Jul 1, 2020
@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

Comment on lines 11 to 33
if conditions == nil {
conditions = &[]metav1.Condition{}
}
Copy link
Member

@liggitt liggitt Jul 2, 2020

Choose a reason for hiding this comment

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

if nil is passed in, isn't the effect of this function lost? should we just return early?

Comment on lines 38 to 61
if conditions == nil {
conditions = &[]metav1.Condition{}
}
Copy link
Member

Choose a reason for hiding this comment

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

same question, if nil, can't we just return early?

if conditions == nil {
conditions = &[]metav1.Condition{}
}
newConditions := []metav1.Condition{}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
newConditions := []metav1.Condition{}
newConditions := make([]metav1.Condition, 0, len(conditions)-1)

@liggitt
Copy link
Member

liggitt commented Jul 2, 2020

a couple nits and doc requests, mostly lgtm

@deads2k deads2k added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jul 6, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 6, 2020
@liggitt
Copy link
Member

liggitt commented Jul 6, 2020

/approve

nit on boilerplate header, lgtm otherwise

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@deads2k
Copy link
Contributor Author

deads2k commented Jul 7, 2020

/retest

@deads2k deads2k added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
@deads2k
Copy link
Contributor Author

deads2k commented Jul 7, 2020

verify fixed. Tagging per comment.

@deads2k
Copy link
Contributor Author

deads2k commented Jul 7, 2020

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 7, 2020

@deads2k: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kind-ipv6 ceb0b8de3a45d3e463b7b0bbe6d63f90325b8e2f link /test pull-kubernetes-e2e-kind-ipv6

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@deads2k deads2k added this to the v1.19 milestone Jul 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit a9ce8c4 into kubernetes:master Jul 9, 2020
airshipbot pushed a commit to airshipit/vino that referenced this pull request Jan 20, 2021
This integrates the standardized status condition schema instituted here:
kubernetes/enhancements#1624

Which is available in the kubernetes 1.19 libraries:
https://github.com/kubernetes/apimachinery/blob/release-1.19/pkg/apis/meta/v1/types.go

As well as the helper libraries added here:
kubernetes/kubernetes#92717

Note there is a bug with observed generation handling, which is fixed in the kubernetes 0.20 libraries:
https: //github.com/kubernetes/kubernetes/commit/5712e33abcea86e7bf699f40a3a838afc1b7c278

This also updates controller-gen from v0.2.5 > v0.3.0

Change-Id: Ib84f0fa2b261fe6ae2568fc8227cb67df1a21260
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. 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.

None yet

4 participants