Merge pull request #8853 from caesarxuchao/HostToNodeName

update PodSpec.Host to PodSpec.NodeName
This commit is contained in:
Tim Hockin
2015-05-28 15:50:12 -07:00
45 changed files with 291 additions and 291 deletions

View File

@@ -1007,8 +1007,8 @@ func ValidatePodStatusUpdate(newPod, oldPod *api.Pod) errs.ValidationErrorList {
allErrs = append(allErrs, ValidateObjectMetaUpdate(&oldPod.ObjectMeta, &newPod.ObjectMeta).Prefix("metadata")...)
// TODO: allow change when bindings are properly decoupled from pods
if newPod.Spec.Host != oldPod.Spec.Host {
allErrs = append(allErrs, errs.NewFieldInvalid("status.host", newPod.Spec.Host, "pod host cannot be changed directly"))
if newPod.Spec.NodeName != oldPod.Spec.NodeName {
allErrs = append(allErrs, errs.NewFieldInvalid("status.nodeName", newPod.Spec.NodeName, "pod nodename cannot be changed directly"))
}
// For status update we ignore changes to pod spec.

View File

@@ -1049,7 +1049,7 @@ func TestValidatePodSpec(t *testing.T) {
NodeSelector: map[string]string{
"key": "value",
},
Host: "foobar",
NodeName: "foobar",
DNSPolicy: api.DNSClusterFirst,
ActiveDeadlineSeconds: &activeDeadlineSeconds,
},
@@ -1116,7 +1116,7 @@ func TestValidatePodSpec(t *testing.T) {
NodeSelector: map[string]string{
"key": "value",
},
Host: "foobar",
NodeName: "foobar",
DNSPolicy: api.DNSClusterFirst,
ActiveDeadlineSeconds: &activeDeadlineSeconds,
},
@@ -1151,7 +1151,7 @@ func TestValidatePod(t *testing.T) {
NodeSelector: map[string]string{
"key": "value",
},
Host: "foobar",
NodeName: "foobar",
},
},
}