Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix v1beta2 types having been copied incorrectly. #1659

Merged
merged 1 commit into from
Oct 8, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 0 additions & 54 deletions pkg/api/v1beta2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,59 +58,5 @@ func init() {
}
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
out.Key = in.Name
out.Name = in.Name
return nil
},
func(in *EnvVar, out *newer.EnvVar, s conversion.Scope) error {
out.Value = in.Value
if in.Name != "" {
out.Name = in.Name
} else {
out.Name = in.Key
}
return nil
},

// Path & MountType are deprecated.
func(in *newer.VolumeMount, out *VolumeMount, s conversion.Scope) error {
out.Name = in.Name
out.ReadOnly = in.ReadOnly
out.MountPath = in.MountPath
out.Path = in.MountPath
out.MountType = "" // MountType is ignored.
return nil
},
func(in *VolumeMount, out *newer.VolumeMount, s conversion.Scope) error {
out.Name = in.Name
out.ReadOnly = in.ReadOnly
if in.MountPath == "" {
out.MountPath = in.Path
} else {
out.MountPath = in.MountPath
}
return nil
},

// MinionList.Items had a wrong name in v1beta1
func(in *newer.MinionList, out *MinionList, s conversion.Scope) error {
s.Convert(&in.TypeMeta, &out.TypeMeta, 0)
s.Convert(&in.Items, &out.Items, 0)
out.Minions = out.Items
return nil
},
func(in *MinionList, out *newer.MinionList, s conversion.Scope) error {
s.Convert(&in.TypeMeta, &out.TypeMeta, 0)
if len(in.Items) == 0 {
s.Convert(&in.Minions, &out.Items, 0)
} else {
s.Convert(&in.Items, &out.Items, 0)
}
return nil
},
)
}
14 changes: 1 addition & 13 deletions pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,13 @@ type VolumeMount struct {
// Optional: Defaults to false (read-write).
ReadOnly bool `yaml:"readOnly,omitempty" json:"readOnly,omitempty"`
// Required.
// Exactly one of the following must be set. If both are set, prefer MountPath.
// DEPRECATED: Path will be removed in a future version of the API.
MountPath string `yaml:"mountPath,omitempty" json:"mountPath,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
// One of: "LOCAL" (local volume) or "HOST" (external mount from the host). Default: LOCAL.
// DEPRECATED: MountType will be removed in a future version of the API.
MountType string `yaml:"mountType,omitempty" json:"mountType,omitempty"`
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Required: This must be a C_IDENTIFIER.
// Exactly one of the following must be set. If both are set, prefer Name.
// DEPRECATED: EnvVar.Key will be removed in a future version of the API.
Name string `yaml:"name" json:"name"`
Key string `yaml:"key,omitempty" json:"key,omitempty"`
// Optional: defaults to "".
Value string `yaml:"value,omitempty" json:"value,omitempty"`
}
Expand Down Expand Up @@ -464,10 +455,7 @@ type Minion struct {
// MinionList is a list of minions.
type MinionList struct {
TypeMeta `json:",inline" yaml:",inline"`
// DEPRECATED: the below Minions is due to a naming mistake and
// will be replaced with Items in the future.
Minions []Minion `json:"minions,omitempty" yaml:"minions,omitempty"`
Items []Minion `json:"items,omitempty" yaml:"items,omitempty"`
Items []Minion `json:"items,omitempty" yaml:"items,omitempty"`
}

// Binding is written by a scheduler to cause a pod to be bound to a host.
Expand Down