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
Conversation
ceb0b8d
to
3fbb0d8
Compare
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. |
if conditions == nil { | ||
conditions = &[]metav1.Condition{} | ||
} |
There was a problem hiding this comment.
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?
if conditions == nil { | ||
conditions = &[]metav1.Condition{} | ||
} |
There was a problem hiding this comment.
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{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newConditions := []metav1.Condition{} | |
newConditions := make([]metav1.Condition, 0, len(conditions)-1) |
a couple nits and doc requests, mostly lgtm |
3fbb0d8
to
436defe
Compare
/approve nit on boilerplate header, lgtm otherwise |
[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 |
436defe
to
542a007
Compare
/retest |
verify fixed. Tagging per comment. |
/retest |
@deads2k: The following test failed, say
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. |
/retest Review the full test history for this PR. Silence the bot with an |
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
adds basic find/set/remove/status for conditions
/priority important-soon
@kubernetes/sig-api-machinery-pr-reviews