Skip to content

Commit

Permalink
Merge pull request kubernetes#5703 from fgrzadkowski/empty_pod_docs
Browse files Browse the repository at this point in the history
Add documentation explaining there must be at least one container in a Pod
  • Loading branch information
vmarmol committed Mar 20, 2015
2 parents c93b44f + a48e9af commit dd74fa7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ const (

// PodSpec is a description of a pod
type PodSpec struct {
Volumes []Volume `json:"volumes"`
Volumes []Volume `json:"volumes"`
// Required: there must be at least one container in a pod.
Containers []Container `json:"containers"`
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
// Required: Set DNS policy.
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,9 @@ const (

// PodSpec is a description of a pod
type PodSpec struct {
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed"`
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
// Required: there must be at least one container in a pod.
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed; there must be at least one container in a Pod"`
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
// Optional: Set DNS policy. Defaults to "ClusterFirst"
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,9 @@ const (

// PodSpec is a description of a pod
type PodSpec struct {
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed"`
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
// Required: there must be at least one container in a pod.
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed; there must be at least one container in a Pod"`
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
// Optional: Set DNS policy. Defaults to "ClusterFirst"
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ const (

// PodSpec is a description of a pod
type PodSpec struct {
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
Containers []Container `json:"containers" description:"list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed"`
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
// Required: there must be at least one container in a pod.
Containers []Container `json:"containers" description:"list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed; there must be at least one container in a Pod"`
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
// Optional: Set DNS policy. Defaults to "ClusterFirst"
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
Expand Down

0 comments on commit dd74fa7

Please sign in to comment.