@@ -77,24 +77,32 @@ The pattern is well-established and we have a good sense of the schema we now wa
77
77
Introduce a type into k8s.io/apimachinery/pkg/apis/meta/v1 for ` Condition ` that looks like
78
78
``` go
79
79
type Condition struct {
80
- // Type of condition in CamelCase.
80
+ // Type of condition in CamelCase or in foo.example.com/CamelCase.
81
+ // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
82
+ // useful (see .node.status.conditions), the ability to deconflict is important.
81
83
// +required
82
84
Type string ` json:"type" protobuf:"bytes,1,opt,name=type"`
83
85
// Status of the condition, one of True, False, Unknown.
84
86
// +required
85
87
Status ConditionStatus ` json:"status" protobuf:"bytes,2,opt,name=status"`
88
+ // If set, this represents the .metadata.generation that the condition was set based upon.
89
+ // For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date
90
+ // with respect to the current state of the instance.
91
+ // +optional
92
+ ObservedGeneration int64 ` json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
86
93
// Last time the condition transitioned from one status to another.
87
- // This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
94
+ // This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
88
95
// +required
89
- LastTransitionTime metav1.Time ` json:"lastTransitionTime" protobuf:"bytes,3 ,opt,name=lastTransitionTime"`
96
+ LastTransitionTime metav1.Time ` json:"lastTransitionTime" protobuf:"bytes,4 ,opt,name=lastTransitionTime"`
90
97
// The reason for the condition's last transition in CamelCase.
91
- // The specific API may choose whether or not this field is considered a guaranteed API.
98
+ // The specific API may choose whether or not this field is considered a guaranteed API.
99
+ // This field may not be empty.
92
100
// +required
93
- Reason string ` json:"reason" protobuf:"bytes,4 ,opt,name=reason"`
101
+ Reason string ` json:"reason" protobuf:"bytes,5 ,opt,name=reason"`
94
102
// A human readable message indicating details about the transition.
95
- // This field is never considered a guaranteed API and may be empty/missing .
96
- // +optional
97
- Message string ` json:"message,omitempty " protobuf:"bytes,5 ,opt,name=message"`
103
+ // This field may be empty.
104
+ // +required
105
+ Message string ` json:"message" protobuf:"bytes,6 ,opt,name=message"`
98
106
}
99
107
```
100
108
@@ -106,8 +114,8 @@ However, it encapsulates the best of what we've learned and will allow new APIs
106
114
1 . ` lastTransitionTime ` is required.
107
115
Some current implementations allow this to be missing, but this makes it difficult for consumers.
108
116
By requiring it, the actor setting the field can set it to the best possible value instead of having clients try to guess.
109
- 2 . ` reason ` is required.
110
- The actor setting the value should always describe why the condition is the way it is, even if that value is, unknown unknowns.
117
+ 2 . ` reason ` is required and must not be empty .
118
+ The actor setting the value should always describe why the condition is the way it is, even if that value is " unknown unknowns" .
111
119
No other actor has the information to make a better choice.
112
120
3 . ` lastHeartbeatTime ` is removed.
113
121
This field caused excessive write loads as we scaled.
0 commit comments