Update ObjectReference to use ResourceVersion string everywhere

Breaks backwards compat for anyone using older versions
This commit is contained in:
Clayton Coleman
2014-10-07 19:37:09 -04:00
parent a5462c0678
commit 094bc3796a
5 changed files with 2 additions and 75 deletions

View File

@@ -59,36 +59,6 @@ func init() {
return nil
},
// ObjectReference has changed type of ResourceVersion internally
func(in *newer.ObjectReference, out *ObjectReference, s conversion.Scope) error {
out.APIVersion = in.APIVersion
out.Kind = in.Kind
out.Namespace = in.Namespace
out.Name = in.Name
out.FieldPath = in.FieldPath
if len(in.ResourceVersion) > 0 {
v, err := strconv.ParseUint(in.ResourceVersion, 10, 64)
if err != nil {
return err
}
out.ResourceVersion = v
}
return nil
},
func(in *ObjectReference, out *newer.ObjectReference, s conversion.Scope) error {
out.APIVersion = in.APIVersion
out.Kind = in.Kind
out.Namespace = in.Namespace
out.Name = in.Name
out.FieldPath = in.FieldPath
if in.ResourceVersion != 0 {
out.ResourceVersion = strconv.FormatUint(in.ResourceVersion, 10)
}
return nil
},
// EnvVar's Key is deprecated in favor of Name.
func(in *newer.EnvVar, out *EnvVar, s conversion.Scope) error {
out.Value = in.Value

View File

@@ -638,7 +638,7 @@ type ObjectReference struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
UID string `json:"uid,omitempty" yaml:"uid,omitempty"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
ResourceVersion uint64 `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
ResourceVersion string `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
// Optional. If referring to a piece of an object instead of an entire object, this string
// should contain a valid field access statement. For example,