Skip to content

Conversation

@thockin
Copy link
Member

@thockin thockin commented Jul 6, 2018

No description provided.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 6, 2018
an observation are not a priori known or would not apply to all instances of a
given Kind. For observations that are well known and apply to all instances, a
regular field is preferred. An example of a Condition that probably should
have been regular field is Pod's "Ready" condition - it is managed by core
Copy link
Member

Choose a reason for hiding this comment

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

have been a regular field

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix


// +optional
Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`
LastHeartbeatTime *unversioned.Time `json:"lastHeartbeatTime,omitempty" description:"last time we got an update on a given condition"`
Copy link
Member

Choose a reason for hiding this comment

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

do we want to note issues with write load in steady state with heartbeat timestamps?

Copy link
Member Author

Choose a reason for hiding this comment

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

will add a note.

given Kind. For observations that are well known and apply to all instances, a
regular field is preferred. An example of a Condition that probably should
have been regular field is Pod's "Ready" condition - it is managed by core
controllers, it is well understood and applies to all Pods.
Copy link
Member

Choose a reason for hiding this comment

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

probably worth noting that it is difficult/impossible to change the factors that combine to determine a single field value. For example, pod readiness could not decide in the future to also include other factors like service endpoint propagation, etc, without potentially breaking API clients that depended on a particular meaning of pod readiness.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting choice, since we are, in fact, changing the factors that combine to define pod readiness :)

I'll take a stab at words.

@thockin thockin force-pushed the conditions-api-convention branch from 89fc788 to a2baa4c Compare July 6, 2018 22:59
@thockin
Copy link
Member Author

thockin commented Jul 6, 2018

re-pushed

@liggitt
Copy link
Member

liggitt commented Jul 8, 2018

lgtm

conditions may be added in the future. Therefore, conditions are represented
using a list/slice, where all have similar structure.
state. They are an extension mechanism intended to be used when the details of
an observation are not a priori known or would not apply to all instances of a

Choose a reason for hiding this comment

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

It will be good to have an example of this line when the details of an observation are not a priori known . I am struggling to think of what that means. Would be helpful to others as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I list "ready" as an example a couple lines later. Not sufficient?

Copy link

@krmayankk krmayankk Jul 9, 2018

Choose a reason for hiding this comment

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

thanks @thockin we were basically writing an operator and struggling to find some guidelines on when to use conditions in it when i stumbled upon this. The ready example below is mainly an example of what should not be a condition since it applies to all instances of the Pod. I am mainly trying to decipher this line when the details of an observation are not a priori known for an example of a condition/observation to which that applies. Thanks for updating the guidelines.

@thockin
Copy link
Member Author

thockin commented Jul 9, 2018 via email

@krmayankk
Copy link

krmayankk commented Jul 10, 2018

thanks @thockin would that mean, that we should add fields in status(rather than a Condition) when we know that fields represents a condition that applies to all instances of that object AND has a well defined/know cause ? I am just clarifying my own thinking. Feel free to include that in the doc if you think that will help

@krmayankk
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 10, 2018
@thockin
Copy link
Member Author

thockin commented Jul 11, 2018 via email

@thockin
Copy link
Member Author

thockin commented Oct 18, 2018

This is still not merged, no reason why not.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

If they are not already assigned, you can assign the PR to them by writing /assign @bgrant0607 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

@thockin thockin merged commit e59e666 into kubernetes:master Oct 18, 2018

Condition types should indicate state in the "abnormal-true" polarity. For
example, if the condition indicates when a policy is invalid, the "is valid"
case is probably the norm, so the condition should be called "Invalid".
Copy link

Choose a reason for hiding this comment

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

The next paragraphs say about the "Ready" and "Succeeded" conditions. Should these examples be updated? It's a bit confusing to have counterexamples in the same document.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how I read this and agreed with it. Is there an earlier discussion? For abnormal conditions, sure. Available = true is not abnormal, and it is the behavior we want (wait for this condition to be true) when new conditions are added (a new client waiting for an old controller to report a condition it shouldn't know about has to wait for both presence and value).

Forcing humans to negate positives is bad UX.

@thockin
Copy link
Member Author

thockin commented Dec 20, 2018

@dmage thanks for this. I saved it until I had a minute..

#3049 to fix


Use of the `Reason` field is encouraged.

Use the `LastHeartbeatTime` with great caution - frequent changes to this field
Copy link
Member

Choose a reason for hiding this comment

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

LastProbeTime is also in use.

The general version of this would be LastUpdateTime.

Given that it's discouraged, isn't urgent to clarify.

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

Labels

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants