Skip to content

Commit b863d46

Browse files
committed
add conditions to metav1
1 parent ff1d6b3 commit b863d46

File tree

1 file changed

+46
-0
lines changed
  • staging/src/k8s.io/apimachinery/pkg/apis/meta/v1

1 file changed

+46
-0
lines changed

staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,3 +1346,49 @@ type PartialObjectMetadataList struct {
13461346
// items contains each of the included items.
13471347
Items []PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"`
13481348
}
1349+
1350+
// Condition contains details for one aspect of the current state of this API Resource.
1351+
// ---
1352+
// This struct is intended for direct use as an array at the field path .status.conditions. For example,
1353+
// type FooStatus struct{
1354+
// // Represents the observations of a foo's current state.
1355+
// // Known .status.conditions.type are: "Available", "Progressing", and "Degraded"
1356+
// // +patchMergeKey=type
1357+
// // +patchStrategy=merge
1358+
// // +listType=map
1359+
// // +listMapKey=type
1360+
// Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
1361+
//
1362+
// // other fields
1363+
// }
1364+
type Condition struct {
1365+
// type of condition in CamelCase or in foo.example.com/CamelCase.
1366+
// ---
1367+
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
1368+
// useful (see .node.status.conditions), the ability to deconflict is important.
1369+
// +required
1370+
Type string `json:"type" protobuf:"bytes,1,opt,name=type"`
1371+
// status of the condition, one of True, False, Unknown.
1372+
// +required
1373+
Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"`
1374+
// observedGeneration represents the .metadata.generation that the condition was set based upon.
1375+
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
1376+
// with respect to the current state of the instance.
1377+
// +optional
1378+
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
1379+
// lastTransitionTime is the last time the condition transitioned from one status to another.
1380+
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
1381+
// +required
1382+
LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"`
1383+
// reason contains a programmatic identifier indicating the reason for the condition's last transition.
1384+
// Producers of specific condition types may define expected values and meanings for this field,
1385+
// and whether the values are considered a guaranteed API.
1386+
// The value should be a CamelCase string.
1387+
// This field may not be empty.
1388+
// +required
1389+
Reason string `json:"reason" protobuf:"bytes,5,opt,name=reason"`
1390+
// message is a human readable message indicating details about the transition.
1391+
// This may be an empty string.
1392+
// +required
1393+
Message string `json:"message" protobuf:"bytes,6,opt,name=message"`
1394+
}

0 commit comments

Comments
 (0)