-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Read BoundPods from etcd instead of ContainerManifestList #1662
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought namespace could be empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All pods are required to have a namespace ("default" should be set at create) - the lack of a namespace is not allowed. ----- Original Message -----
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Except in the other PR there was discussion that "" == "default" - Do we need to hold this up until that lands? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, I agree that "" == default, I thought that was what we had decided, or I would have argued for it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that should block this pull
|
||
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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I totally missed something - how did we end up with ID and UID at the same time? Or is this just transient? I'm assuming it's just transient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just transient - I won't rename ID -> Name until after this happens.
----- Original Message -----