mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #8980 from caesarxuchao/Remove_TemplateRef
remove ReplicationControllerSpec.TemplateRef
This commit is contained in:
commit
fdefd120c1
@ -1582,14 +1582,6 @@ func deepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *R
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
|
||||||
out.TemplateRef = new(ObjectReference)
|
|
||||||
if err := deepCopy_api_ObjectReference(*in.TemplateRef, out.TemplateRef, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.TemplateRef = nil
|
|
||||||
}
|
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(PodTemplateSpec)
|
out.Template = new(PodTemplateSpec)
|
||||||
if err := deepCopy_api_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
if err := deepCopy_api_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
||||||
|
@ -106,8 +106,8 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
|
|||||||
j.Target.Name = c.RandString()
|
j.Target.Name = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *api.ReplicationControllerSpec, c fuzz.Continue) {
|
func(j *api.ReplicationControllerSpec, c fuzz.Continue) {
|
||||||
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
||||||
j.TemplateRef = nil // this is required for round trip
|
//j.TemplateRef = nil // this is required for round trip
|
||||||
},
|
},
|
||||||
func(j *api.ReplicationControllerStatus, c fuzz.Continue) {
|
func(j *api.ReplicationControllerStatus, c fuzz.Continue) {
|
||||||
// only replicas round trips
|
// only replicas round trips
|
||||||
|
@ -966,7 +966,7 @@ type ReplicationControllerSpec struct {
|
|||||||
// TemplateRef is a reference to an object that describes the pod that will be created if
|
// TemplateRef is a reference to an object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected. This reference is ignored if a Template is set.
|
// insufficient replicas are detected. This reference is ignored if a Template is set.
|
||||||
// Must be set before converting to a v1beta3 API object
|
// Must be set before converting to a v1beta3 API object
|
||||||
TemplateRef *ObjectReference `json:"templateRef,omitempty"`
|
//TemplateRef *ObjectReference `json:"templateRef,omitempty"`
|
||||||
|
|
||||||
// Template is the object that describes the pod that will be created if
|
// Template is the object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected. Internally, this takes precedence over a
|
// insufficient replicas are detected. Internally, this takes precedence over a
|
||||||
|
@ -193,14 +193,14 @@ func convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *a
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
//if in.TemplateRef != nil {
|
||||||
out.TemplateRef = new(ObjectReference)
|
// out.TemplateRef = new(ObjectReference)
|
||||||
if err := convert_api_ObjectReference_To_v1_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
// if err := convert_api_ObjectReference_To_v1_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
||||||
return err
|
// return err
|
||||||
}
|
// }
|
||||||
} else {
|
//} else {
|
||||||
out.TemplateRef = nil
|
// out.TemplateRef = nil
|
||||||
}
|
//}
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(PodTemplateSpec)
|
out.Template = new(PodTemplateSpec)
|
||||||
if err := convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
if err := convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||||
@ -225,14 +225,14 @@ func convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *R
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
//if in.TemplateRef != nil {
|
||||||
out.TemplateRef = new(api.ObjectReference)
|
// out.TemplateRef = new(api.ObjectReference)
|
||||||
if err := convert_v1_ObjectReference_To_api_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
// if err := convert_v1_ObjectReference_To_api_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
||||||
return err
|
// return err
|
||||||
}
|
// }
|
||||||
} else {
|
//} else {
|
||||||
out.TemplateRef = nil
|
// out.TemplateRef = nil
|
||||||
}
|
//}
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(api.PodTemplateSpec)
|
out.Template = new(api.PodTemplateSpec)
|
||||||
if err := convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
if err := convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||||
|
@ -1518,14 +1518,6 @@ func deepCopy_v1_ReplicationControllerSpec(in ReplicationControllerSpec, out *Re
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
|
||||||
out.TemplateRef = new(ObjectReference)
|
|
||||||
if err := deepCopy_v1_ObjectReference(*in.TemplateRef, out.TemplateRef, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.TemplateRef = nil
|
|
||||||
}
|
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(PodTemplateSpec)
|
out.Template = new(PodTemplateSpec)
|
||||||
if err := deepCopy_v1_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
if err := deepCopy_v1_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
||||||
|
@ -962,7 +962,7 @@ type ReplicationControllerSpec struct {
|
|||||||
|
|
||||||
// TemplateRef is a reference to an object that describes the pod that will be created if
|
// TemplateRef is a reference to an object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected.
|
// insufficient replicas are detected.
|
||||||
TemplateRef *ObjectReference `json:"templateRef,omitempty" description:"reference to an object that describes the pod that will be created if insufficient replicas are detected"`
|
//TemplateRef *ObjectReference `json:"templateRef,omitempty" description:"reference to an object that describes the pod that will be created if insufficient replicas are detected"`
|
||||||
|
|
||||||
// Template is the object that describes the pod that will be created if
|
// Template is the object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected. This takes precedence over a
|
// insufficient replicas are detected. This takes precedence over a
|
||||||
|
@ -474,13 +474,13 @@ func addConversionFuncs() {
|
|||||||
if err := s.Convert(&in.Selector, &out.ReplicaSelector, 0); err != nil {
|
if err := s.Convert(&in.Selector, &out.ReplicaSelector, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil && in.Template == nil {
|
//if in.TemplateRef != nil && in.Template == nil {
|
||||||
return &api.ConversionError{
|
// return &api.ConversionError{
|
||||||
In: in,
|
// In: in,
|
||||||
Out: out,
|
// Out: out,
|
||||||
Message: "objects with a template ref cannot be converted to older objects, must populate template",
|
// Message: "objects with a template ref cannot be converted to older objects, must populate template",
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
if err := s.Convert(in.Template, &out.PodTemplate, 0); err != nil {
|
if err := s.Convert(in.Template, &out.PodTemplate, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -253,13 +253,13 @@ func addConversionFuncs() {
|
|||||||
if err := s.Convert(&in.Selector, &out.ReplicaSelector, 0); err != nil {
|
if err := s.Convert(&in.Selector, &out.ReplicaSelector, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil && in.Template == nil {
|
//if in.TemplateRef != nil && in.Template == nil {
|
||||||
return &api.ConversionError{
|
// return &api.ConversionError{
|
||||||
In: in,
|
// In: in,
|
||||||
Out: out,
|
// Out: out,
|
||||||
Message: "objects with a template ref cannot be converted to older objects, must populate template",
|
// Message: "objects with a template ref cannot be converted to older objects, must populate template",
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
if err := s.Convert(in.Template, &out.PodTemplate, 0); err != nil {
|
if err := s.Convert(in.Template, &out.PodTemplate, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -1544,14 +1544,6 @@ func convert_api_ReplicationControllerSpec_To_v1beta3_ReplicationControllerSpec(
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
|
||||||
out.TemplateRef = new(ObjectReference)
|
|
||||||
if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.TemplateRef = nil
|
|
||||||
}
|
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(PodTemplateSpec)
|
out.Template = new(PodTemplateSpec)
|
||||||
if err := convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
if err := convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||||
@ -3641,14 +3633,6 @@ func convert_v1beta3_ReplicationControllerSpec_To_api_ReplicationControllerSpec(
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
|
||||||
out.TemplateRef = new(api.ObjectReference)
|
|
||||||
if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(in.TemplateRef, out.TemplateRef, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.TemplateRef = nil
|
|
||||||
}
|
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(api.PodTemplateSpec)
|
out.Template = new(api.PodTemplateSpec)
|
||||||
if err := convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
if err := convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
||||||
|
@ -1517,14 +1517,6 @@ func deepCopy_v1beta3_ReplicationControllerSpec(in ReplicationControllerSpec, ou
|
|||||||
} else {
|
} else {
|
||||||
out.Selector = nil
|
out.Selector = nil
|
||||||
}
|
}
|
||||||
if in.TemplateRef != nil {
|
|
||||||
out.TemplateRef = new(ObjectReference)
|
|
||||||
if err := deepCopy_v1beta3_ObjectReference(*in.TemplateRef, out.TemplateRef, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.TemplateRef = nil
|
|
||||||
}
|
|
||||||
if in.Template != nil {
|
if in.Template != nil {
|
||||||
out.Template = new(PodTemplateSpec)
|
out.Template = new(PodTemplateSpec)
|
||||||
if err := deepCopy_v1beta3_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
if err := deepCopy_v1beta3_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
||||||
|
@ -966,7 +966,7 @@ type ReplicationControllerSpec struct {
|
|||||||
|
|
||||||
// TemplateRef is a reference to an object that describes the pod that will be created if
|
// TemplateRef is a reference to an object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected.
|
// insufficient replicas are detected.
|
||||||
TemplateRef *ObjectReference `json:"templateRef,omitempty" description:"reference to an object that describes the pod that will be created if insufficient replicas are detected"`
|
//TemplateRef *ObjectReference `json:"templateRef,omitempty" description:"reference to an object that describes the pod that will be created if insufficient replicas are detected"`
|
||||||
|
|
||||||
// Template is the object that describes the pod that will be created if
|
// Template is the object that describes the pod that will be created if
|
||||||
// insufficient replicas are detected. This takes precedence over a
|
// insufficient replicas are detected. This takes precedence over a
|
||||||
|
Loading…
Reference in New Issue
Block a user