mirror of https://github.com/k3s-io/k3s
change the StatefulSet observedGeneration from a pointer to an int for consistency
parent
6000712803
commit
2098cc2639
|
@ -731,6 +731,9 @@ func appsFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||
s.Spec.RevisionHistoryLimit = new(int32)
|
||||
*s.Spec.RevisionHistoryLimit = 10
|
||||
}
|
||||
if s.Status.ObservedGeneration == nil {
|
||||
s.Status.ObservedGeneration = new(int64)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
|
|||
Convert_apps_StatefulSetUpdateStrategy_To_v1beta2_StatefulSetUpdateStrategy,
|
||||
Convert_extensions_RollingUpdateDaemonSet_To_v1beta2_RollingUpdateDaemonSet,
|
||||
Convert_v1beta2_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet,
|
||||
Convert_v1beta2_StatefulSetStatus_To_apps_StatefulSetStatus,
|
||||
Convert_apps_StatefulSetStatus_To_v1beta2_StatefulSetStatus,
|
||||
// extensions
|
||||
// TODO: below conversions should be dropped in favor of auto-generated
|
||||
// ones, see https://github.com/kubernetes/kubernetes/issues/39865
|
||||
|
@ -223,6 +225,31 @@ func Convert_apps_StatefulSetUpdateStrategy_To_v1beta2_StatefulSetUpdateStrategy
|
|||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta2_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1beta2.StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error {
|
||||
out.ObservedGeneration = new(int64)
|
||||
*out.ObservedGeneration = in.ObservedGeneration
|
||||
out.Replicas = in.Replicas
|
||||
out.ReadyReplicas = in.ReadyReplicas
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.UpdatedReplicas = in.UpdatedReplicas
|
||||
out.CurrentRevision = in.CurrentRevision
|
||||
out.UpdateRevision = in.UpdateRevision
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_apps_StatefulSetStatus_To_v1beta2_StatefulSetStatus(in *apps.StatefulSetStatus, out *appsv1beta2.StatefulSetStatus, s conversion.Scope) error {
|
||||
if in.ObservedGeneration != nil {
|
||||
out.ObservedGeneration = *in.ObservedGeneration
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
out.ReadyReplicas = in.ReadyReplicas
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.UpdatedReplicas = in.UpdatedReplicas
|
||||
out.CurrentRevision = in.CurrentRevision
|
||||
out.UpdateRevision = in.UpdateRevision
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_extensions_ScaleStatus_To_v1beta2_ScaleStatus(in *extensions.ScaleStatus, out *appsv1beta2.ScaleStatus, s conversion.Scope) error {
|
||||
out.Replicas = int32(in.Replicas)
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ type StatefulSetStatus struct {
|
|||
// observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
|
||||
// StatefulSet's generation, which is updated on mutation by the API Server.
|
||||
// +optional
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
|
||||
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
|
||||
|
||||
// replicas is the number of Pods created by the StatefulSet controller.
|
||||
Replicas int32 `json:"replicas" protobuf:"varint,2,opt,name=replicas"`
|
||||
|
|
Loading…
Reference in New Issue