diff --git a/pkg/api/types.go b/pkg/api/types.go index ca8011fde23..64af4110920 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -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. diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 3adb770db03..e1bc92c0899 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -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'"` diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index c5076b6b101..d5adb6d33da 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -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'"` diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 2b47b73a27a..2ddc3e1ce4f 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -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'"`