Read BoundPods from etcd instead of ContainerManifestList
There are three values that uniquely identify a pod on a host - the configuration source (etcd, file, http), the pod name, and the pod namespace. This change ensures that configuration properly makes those names unique by changing podFullName to contain both name (currently ID in v1beta1, Name in v1beta3) and namespace. The Kubelet does not properly handle information requests for pods not in the default namespace at this time.
This commit is contained in:

committed by
Eric Paris

parent
332a03b085
commit
892942af8f
@@ -437,3 +437,25 @@ func ValidateReadOnlyPersistentDisks(volumes []api.Volume) errs.ErrorList {
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidateBoundPod tests if required fields on a bound pod are set.
|
||||
func ValidateBoundPod(pod *api.BoundPod) (errors []error) {
|
||||
if !util.IsDNSSubdomain(pod.ID) {
|
||||
errors = append(errors, errs.NewFieldInvalid("id", pod.ID))
|
||||
}
|
||||
if !util.IsDNSSubdomain(pod.Namespace) {
|
||||
errors = append(errors, errs.NewFieldInvalid("namespace", pod.Namespace))
|
||||
}
|
||||
containerManifest := &api.ContainerManifest{
|
||||
Version: "v1beta2",
|
||||
ID: pod.ID,
|
||||
UUID: pod.UID,
|
||||
Containers: pod.Spec.Containers,
|
||||
Volumes: pod.Spec.Volumes,
|
||||
RestartPolicy: pod.Spec.RestartPolicy,
|
||||
}
|
||||
if errs := ValidateManifest(containerManifest); len(errs) != 0 {
|
||||
errors = append(errors, errs...)
|
||||
}
|
||||
return errors
|
||||
}
|
||||
|
Reference in New Issue
Block a user