From a48e9af28dc77bed85d090a8e35dd3a0354d4629 Mon Sep 17 00:00:00 2001 From: Filip Grzadkowski Date: Fri, 20 Mar 2015 11:10:30 +0100 Subject: [PATCH] Add documentation explaining there must be at least one container in a Pod --- pkg/api/types.go | 3 ++- pkg/api/v1beta1/types.go | 5 +++-- pkg/api/v1beta2/types.go | 5 +++-- pkg/api/v1beta3/types.go | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index ca8011fde23ff..64af4110920bf 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 3adb770db036e..e1bc92c0899ee 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 c5076b6b101d9..d5adb6d33dace 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 2b47b73a27a54..2ddc3e1ce4f01 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'"`