mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 04:53:11 +00:00
Added conditions to statefulset
This commit is contained in:
parent
9ed5d380aa
commit
825821610c
@ -195,6 +195,27 @@ type StatefulSetStatus struct {
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
CollisionCount *int32
|
||||
|
||||
// Represents the latest available observations of a statefulset's current state.
|
||||
Conditions []StatefulSetCondition
|
||||
}
|
||||
|
||||
type StatefulSetConditionType string
|
||||
|
||||
// TODO: Add valid condition types for Statefulsets.
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
type StatefulSetCondition struct {
|
||||
// Type of statefulset condition.
|
||||
Type StatefulSetConditionType
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status api.ConditionStatus
|
||||
// The last time this condition was updated.
|
||||
LastTransitionTime metav1.Time
|
||||
// The reason for the condition's last transition.
|
||||
Reason string
|
||||
// A human readable message indicating details about the transition.
|
||||
Message string
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
@ -465,6 +465,12 @@ func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulS
|
||||
out.CollisionCount = new(int32)
|
||||
*out.CollisionCount = *in.CollisionCount
|
||||
}
|
||||
out.Conditions = make([]apps.StatefulSetCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := Convert_v1_StatefulSetCondition_To_apps_StatefulSetCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -482,5 +488,11 @@ func Convert_apps_StatefulSetStatus_To_v1_StatefulSetStatus(in *apps.StatefulSet
|
||||
out.CollisionCount = new(int32)
|
||||
*out.CollisionCount = *in.CollisionCount
|
||||
}
|
||||
out.Conditions = make([]appsv1.StatefulSetCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := Convert_apps_StatefulSetCondition_To_v1_StatefulSetCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -223,6 +223,12 @@ func Convert_v1beta2_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1beta2
|
||||
out.CollisionCount = new(int32)
|
||||
*out.CollisionCount = *in.CollisionCount
|
||||
}
|
||||
out.Conditions = make([]apps.StatefulSetCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := Convert_v1beta2_StatefulSetCondition_To_apps_StatefulSetCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -240,6 +246,12 @@ func Convert_apps_StatefulSetStatus_To_v1beta2_StatefulSetStatus(in *apps.Statef
|
||||
out.CollisionCount = new(int32)
|
||||
*out.CollisionCount = *in.CollisionCount
|
||||
}
|
||||
out.Conditions = make([]appsv1beta2.StatefulSetCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := Convert_apps_StatefulSetCondition_To_v1beta2_StatefulSetCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,31 @@ type StatefulSetStatus struct {
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,9,opt,name=collisionCount"`
|
||||
|
||||
// Represents the latest available observations of a statefulset's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
|
||||
}
|
||||
|
||||
type StatefulSetConditionType string
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
type StatefulSetCondition struct {
|
||||
// Type of statefulset condition.
|
||||
Type StatefulSetConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
@ -247,6 +247,31 @@ type StatefulSetStatus struct {
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,9,opt,name=collisionCount"`
|
||||
|
||||
// Represents the latest available observations of a statefulset's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
|
||||
}
|
||||
|
||||
type StatefulSetConditionType string
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
type StatefulSetCondition struct {
|
||||
// Type of statefulset condition.
|
||||
Type StatefulSetConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
@ -254,6 +254,31 @@ type StatefulSetStatus struct {
|
||||
// newest ControllerRevision.
|
||||
// +optional
|
||||
CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,9,opt,name=collisionCount"`
|
||||
|
||||
// Represents the latest available observations of a statefulset's current state.
|
||||
// +optional
|
||||
// +patchMergeKey=type
|
||||
// +patchStrategy=merge
|
||||
Conditions []StatefulSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
|
||||
}
|
||||
|
||||
type StatefulSetConditionType string
|
||||
|
||||
// StatefulSetCondition describes the state of a statefulset at a certain point.
|
||||
type StatefulSetCondition struct {
|
||||
// Type of statefulset condition.
|
||||
Type StatefulSetConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// A human readable message indicating details about the transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
Loading…
Reference in New Issue
Block a user