Merge pull request #8980 from caesarxuchao/Remove_TemplateRef

remove ReplicationControllerSpec.TemplateRef
This commit is contained in:
Rohit Jnagal 2015-05-29 14:53:25 -07:00
commit fdefd120c1
11 changed files with 35 additions and 75 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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