From 3d6085e692553b2d49882466f803f67bcc461943 Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Fri, 20 Feb 2015 15:47:06 -0500 Subject: [PATCH] Add doc in types --- pkg/api/v1beta1/types.go | 48 ++++++++++++++++++++------------------ pkg/api/v1beta2/types.go | 50 ++++++++++++++++++++++------------------ pkg/api/v1beta3/types.go | 48 ++++++++++++++++++++------------------ 3 files changed, 79 insertions(+), 67 deletions(-) diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 99155682c6..ec75dc6c11 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -158,7 +158,7 @@ type GitRepo struct { // Adapts a Secret into a VolumeSource type SecretSource struct { // Reference to a Secret - Target ObjectReference `json:"target"` + Target ObjectReference `json:"target" description:"target is a reference to a secret"` } // Port represents a network port in a single container @@ -434,6 +434,7 @@ type ContainerStatus struct { ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } +// PodConditionKind is a valid value for PodCondition.Kind type PodConditionKind string // These are valid conditions of pod. @@ -445,8 +446,10 @@ const ( // TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. type PodCondition struct { - Kind PodConditionKind `json:"kind" description:"kind of the condition, currently only Ready"` - Status ConditionStatus `json:"status" description:"status of the condition, one of Full, None, Unknown"` + // Kind is the kind of the condition + Kind PodConditionKind `json:"kind" description:"kind of the condition, currently only Ready"` + // Status is the status of the condition + Status ConditionStatus `json:"status" description:"status of the condition, one of Full, None, Unknown"` } // PodInfo contains one entry for every container with available info. @@ -710,17 +713,18 @@ type Namespace struct { Labels map[string]string `json:"labels,omitempty" description:"map of string keys and values that can be used to organize and categorize namespaces"` // Spec defines the behavior of the Namespace. - Spec NamespaceSpec `json:"spec,omitempty"` + Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace"` // Status describes the current status of a Namespace - Status NamespaceStatus `json:"status,omitempty"` + Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace"` } // NamespaceList is a list of Namespaces. type NamespaceList struct { TypeMeta `json:",inline"` - Items []Namespace `json:"items"` + // Items is the list of Namespace objects in the list + Items []Namespace `json:"items" description:"items is the list of Namespace objects in the list"` } // Binding is written by a scheduler to cause a pod to be bound to a host. @@ -1017,17 +1021,17 @@ const ( // LimitRangeItem defines a min/max usage limit for any resource that matches on kind type LimitRangeItem struct { // Type of resource that this limit applies to - Type LimitType `json:"type,omitempty"` + Type LimitType `json:"type,omitempty" description:"type of resource that this limit applies to"` // Max usage constraints on this kind by resource name - Max ResourceList `json:"max,omitempty"` + Max ResourceList `json:"max,omitempty" description:"max usage constraints on this kind by resource name"` // Min usage constraints on this kind by resource name - Min ResourceList `json:"min,omitempty"` + Min ResourceList `json:"min,omitempty" description:"min usage constraints on this kind by resource name"` } // LimitRangeSpec defines a min/max usage limit for resources that match on kind type LimitRangeSpec struct { // Limits is the list of LimitRangeItem objects that are enforced - Limits []LimitRangeItem `json:"limits"` + Limits []LimitRangeItem `json:"limits" description:"limits is the list of LimitRangeItem objects that are enforced"` } // LimitRange sets resource usage limits for each kind of resource in a Namespace @@ -1035,7 +1039,7 @@ type LimitRange struct { TypeMeta `json:",inline"` // Spec defines the limits enforced - Spec LimitRangeSpec `json:"spec,omitempty"` + Spec LimitRangeSpec `json:"spec,omitempty" description:"spec defines the limits enforced"` } // LimitRangeList is a list of LimitRange items. @@ -1043,7 +1047,7 @@ type LimitRangeList struct { TypeMeta `json:",inline"` // Items is a list of LimitRange objects - Items []LimitRange `json:"items"` + Items []LimitRange `json:"items" description:"items is a list of LimitRange objects"` } // The following identify resource constants for Kubernetes object types @@ -1061,15 +1065,15 @@ const ( // ResourceQuotaSpec defines the desired hard limits to enforce for Quota type ResourceQuotaSpec struct { // Hard is the set of desired hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of desired hard limits for each named resource"` } // ResourceQuotaStatus defines the enforced hard limits and observed use type ResourceQuotaStatus struct { // Hard is the set of enforced hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of enforced hard limits for each named resource"` // Used is the current observed total usage of the resource in the namespace - Used ResourceList `json:"used,omitempty"` + Used ResourceList `json:"used,omitempty" description:"used is the current observed total usage of the resource in the namespace"` } // ResourceQuota sets aggregate quota restrictions enforced per namespace @@ -1077,10 +1081,10 @@ type ResourceQuota struct { TypeMeta `json:",inline"` // Spec defines the desired quota - Spec ResourceQuotaSpec `json:"spec,omitempty"` + Spec ResourceQuotaSpec `json:"spec,omitempty" description:"spec defines the desired quota"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaUsage captures system observed quota status per namespace @@ -1089,7 +1093,7 @@ type ResourceQuotaUsage struct { TypeMeta `json:",inline"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaList is a list of ResourceQuota items @@ -1097,7 +1101,7 @@ type ResourceQuotaList struct { TypeMeta `json:",inline"` // Items is a list of ResourceQuota objects - Items []ResourceQuota `json:"items"` + Items []ResourceQuota `json:"items" description:"items is a list of ResourceQuota objects"` } // Secret holds secret data of a certain type. The total bytes of the values in @@ -1107,10 +1111,10 @@ type Secret struct { // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. // The serialized form of the secret data is a base64 encoded string. - Data map[string][]byte `json:"data,omitempty"` + Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"` // Used to facilitate programatic handling of secret data. - Type SecretType `json:"type,omitempty"` + Type SecretType `json:"type,omitempty" description:"type facilitates programmatic handling of secret data"` } const MaxSecretSize = 1 * 1024 * 1024 @@ -1124,5 +1128,5 @@ const ( type SecretList struct { TypeMeta `json:",inline"` - Items []Secret `json:"items"` + Items []Secret `json:"items" description:"items is a list of secret objects"` } diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 4aad894717..8e6793be05 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -86,7 +86,7 @@ type EmptyDir struct{} // Adapts a Secret into a VolumeSource type SecretSource struct { // Reference to a Secret - Target ObjectReference `json:"target"` + Target ObjectReference `json:"target" description:"target is a reference to a secret"` } // Protocol defines network protocols supported for things like conatiner ports. @@ -398,6 +398,7 @@ type ContainerStatus struct { ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } +// PodConditionKind is a valid value for PodCondition.Kind type PodConditionKind string // These are valid conditions of pod. @@ -409,8 +410,10 @@ const ( // TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. type PodCondition struct { - Kind PodConditionKind `json:"kind" description:"kind of the condition, currently only Ready"` - Status ConditionStatus `json:"status" description:"status of the condition, one of Full, None, Unknown"` + // Kind is the kind of the condition + Kind PodConditionKind `json:"kind" description:"kind of the condition, currently only Ready"` + // Status is the status of the condition + Status ConditionStatus `json:"status" description:"status of the condition, one of Full, None, Unknown"` } // PodInfo contains one entry for every container with available info. @@ -671,17 +674,18 @@ type Namespace struct { Labels map[string]string `json:"labels,omitempty" description:"map of string keys and values that can be used to organize and categorize namespaces"` // Spec defines the behavior of the Namespace. - Spec NamespaceSpec `json:"spec,omitempty"` + Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace"` // Status describes the current status of a Namespace - Status NamespaceStatus `json:"status,omitempty"` + Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace"` } // NamespaceList is a list of Namespaces. type NamespaceList struct { TypeMeta `json:",inline"` - Items []Namespace `json:"items"` + // Items is the list of Namespace objects in the list + Items []Namespace `json:"items" description:"items is the list of Namespace objects in the list"` } // Binding is written by a scheduler to cause a pod to be bound to a host. @@ -1020,17 +1024,17 @@ const ( // LimitRangeItem defines a min/max usage limit for any resource that matches on kind type LimitRangeItem struct { // Type of resource that this limit applies to - Type LimitType `json:"type,omitempty"` + Type LimitType `json:"type,omitempty" description:"type of resource that this limit applies to"` // Max usage constraints on this kind by resource name - Max ResourceList `json:"max,omitempty"` + Max ResourceList `json:"max,omitempty" description:"max usage constraints on this kind by resource name"` // Min usage constraints on this kind by resource name - Min ResourceList `json:"min,omitempty"` + Min ResourceList `json:"min,omitempty" description:"min usage constraints on this kind by resource name"` } // LimitRangeSpec defines a min/max usage limit for resources that match on kind type LimitRangeSpec struct { // Limits is the list of LimitRangeItem objects that are enforced - Limits []LimitRangeItem `json:"limits"` + Limits []LimitRangeItem `json:"limits" description:"limits is the list of LimitRangeItem objects that are enforced"` } // LimitRange sets resource usage limits for each kind of resource in a Namespace @@ -1038,7 +1042,7 @@ type LimitRange struct { TypeMeta `json:",inline"` // Spec defines the limits enforced - Spec LimitRangeSpec `json:"spec,omitempty"` + Spec LimitRangeSpec `json:"spec,omitempty" description:"spec defines the limits enforced"` } // LimitRangeList is a list of LimitRange items. @@ -1046,7 +1050,7 @@ type LimitRangeList struct { TypeMeta `json:",inline"` // Items is a list of LimitRange objects - Items []LimitRange `json:"items"` + Items []LimitRange `json:"items" description:"items is a list of LimitRange objects"` } // The following identify resource constants for Kubernetes object types @@ -1064,15 +1068,15 @@ const ( // ResourceQuotaSpec defines the desired hard limits to enforce for Quota type ResourceQuotaSpec struct { // Hard is the set of desired hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of desired hard limits for each named resource"` } // ResourceQuotaStatus defines the enforced hard limits and observed use type ResourceQuotaStatus struct { // Hard is the set of enforced hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of enforced hard limits for each named resource"` // Used is the current observed total usage of the resource in the namespace - Used ResourceList `json:"used,omitempty"` + Used ResourceList `json:"used,omitempty" description:"used is the current observed total usage of the resource in the namespace"` } // ResourceQuota sets aggregate quota restrictions enforced per namespace @@ -1080,10 +1084,10 @@ type ResourceQuota struct { TypeMeta `json:",inline"` // Spec defines the desired quota - Spec ResourceQuotaSpec `json:"spec,omitempty"` + Spec ResourceQuotaSpec `json:"spec,omitempty" description:"spec defines the desired quota"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaUsage captures system observed quota status per namespace @@ -1092,7 +1096,7 @@ type ResourceQuotaUsage struct { TypeMeta `json:",inline"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaList is a list of ResourceQuota items @@ -1100,7 +1104,7 @@ type ResourceQuotaList struct { TypeMeta `json:",inline"` // Items is a list of ResourceQuota objects - Items []ResourceQuota `json:"items"` + Items []ResourceQuota `json:"items" description:"items is a list of ResourceQuota objects"` } // Secret holds secret data of a certain type. The total bytes of the values in @@ -1109,11 +1113,11 @@ type Secret struct { TypeMeta `json:",inline"` // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. - Data map[string][]byte `json:"data,omitempty"` + // The serialized form of the secret data is a base64 encoded string. + Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"` // Used to facilitate programatic handling of secret data. - // The serialized form of the secret data is a base64 encoded string. - Type SecretType `json:"type,omitempty"` + Type SecretType `json:"type,omitempty" description:"type facilitates programmatic handling of secret data"` } const MaxSecretSize = 1 * 1024 * 1024 @@ -1127,5 +1131,5 @@ const ( type SecretList struct { TypeMeta `json:",inline"` - Items []Secret `json:"items"` + Items []Secret `json:"items" description:"items is a list of secret objects"` } diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 3b1214fde3..5293ee5c6a 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -251,7 +251,7 @@ type GitRepo struct { // Adapts a Secret into a VolumeSource type SecretSource struct { // Reference to a Secret - Target ObjectReference `json:"target"` + Target ObjectReference `json:"target" description:"target is a reference to a secret"` } // Port represents a network port in a single container. @@ -490,6 +490,7 @@ const ( PodUnknown PodPhase = "Unknown" ) +// PodConditionKind is a valid value for PodCondition.Kind type PodConditionKind string // These are valid conditions of pod. @@ -501,8 +502,10 @@ const ( // TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. type PodCondition struct { - Kind PodConditionKind `json:"kind"` - Status ConditionStatus `json:"status"` + // Status is the status of the condition + Kind PodConditionKind `json:"kind"` + // Status is the status of the condition + Status ConditionStatus `json:"status"` } // PodInfo contains one entry for every container with available info. @@ -890,10 +893,10 @@ type Namespace struct { ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of the Namespace. - Spec NamespaceSpec `json:"spec,omitempty"` + Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace"` // Status describes the current status of a Namespace - Status NamespaceStatus `json:"status,omitempty"` + Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace"` } // NamespaceList is a list of Namespaces. @@ -901,7 +904,8 @@ type NamespaceList struct { TypeMeta `json:",inline"` ListMeta `json:"metadata,omitempty"` - Items []Namespace `json:"items"` + // Items is the list of Namespace objects in the list + Items []Namespace `json:"items" description:"items is the list of Namespace objects in the list"` } // Binding is written by a scheduler to cause a pod to be bound to a node. Name is not @@ -1155,17 +1159,17 @@ const ( // LimitRangeItem defines a min/max usage limit for any resource that matches on kind type LimitRangeItem struct { // Type of resource that this limit applies to - Type LimitType `json:"type,omitempty"` + Type LimitType `json:"type,omitempty" description:"type of resource that this limit applies to"` // Max usage constraints on this kind by resource name - Max ResourceList `json:"max,omitempty"` + Max ResourceList `json:"max,omitempty" description:"max usage constraints on this kind by resource name"` // Min usage constraints on this kind by resource name - Min ResourceList `json:"min,omitempty"` + Min ResourceList `json:"min,omitempty" description:"min usage constraints on this kind by resource name"` } // LimitRangeSpec defines a min/max usage limit for resources that match on kind type LimitRangeSpec struct { // Limits is the list of LimitRangeItem objects that are enforced - Limits []LimitRangeItem `json:"limits"` + Limits []LimitRangeItem `json:"limits" description:"limits is the list of LimitRangeItem objects that are enforced"` } // LimitRange sets resource usage limits for each kind of resource in a Namespace @@ -1174,7 +1178,7 @@ type LimitRange struct { ObjectMeta `json:"metadata,omitempty"` // Spec defines the limits enforced - Spec LimitRangeSpec `json:"spec,omitempty"` + Spec LimitRangeSpec `json:"spec,omitempty" description:"spec defines the limits enforced"` } // LimitRangeList is a list of LimitRange items. @@ -1183,7 +1187,7 @@ type LimitRangeList struct { ListMeta `json:"metadata,omitempty"` // Items is a list of LimitRange objects - Items []LimitRange `json:"items"` + Items []LimitRange `json:"items" description:"items is a list of LimitRange objects"` } // The following identify resource constants for Kubernetes object types @@ -1201,15 +1205,15 @@ const ( // ResourceQuotaSpec defines the desired hard limits to enforce for Quota type ResourceQuotaSpec struct { // Hard is the set of desired hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of desired hard limits for each named resource"` } // ResourceQuotaStatus defines the enforced hard limits and observed use type ResourceQuotaStatus struct { // Hard is the set of enforced hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` + Hard ResourceList `json:"hard,omitempty" description:"hard is the set of enforced hard limits for each named resource"` // Used is the current observed total usage of the resource in the namespace - Used ResourceList `json:"used,omitempty"` + Used ResourceList `json:"used,omitempty" description:"used is the current observed total usage of the resource in the namespace"` } // ResourceQuota sets aggregate quota restrictions enforced per namespace @@ -1218,10 +1222,10 @@ type ResourceQuota struct { ObjectMeta `json:"metadata,omitempty"` // Spec defines the desired quota - Spec ResourceQuotaSpec `json:"spec,omitempty"` + Spec ResourceQuotaSpec `json:"spec,omitempty" description:"spec defines the desired quota"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaUsage captures system observed quota status per namespace @@ -1231,7 +1235,7 @@ type ResourceQuotaUsage struct { ObjectMeta `json:"metadata,omitempty"` // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` + Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage"` } // ResourceQuotaList is a list of ResourceQuota items @@ -1240,7 +1244,7 @@ type ResourceQuotaList struct { ListMeta `json:"metadata,omitempty"` // Items is a list of ResourceQuota objects - Items []ResourceQuota `json:"items"` + Items []ResourceQuota `json:"items" description:"items is a list of ResourceQuota objects"` } // Secret holds secret data of a certain type. The total bytes of the values in @@ -1251,10 +1255,10 @@ type Secret struct { // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. // The serialized form of the secret data is a base64 encoded string. - Data map[string][]byte `json:"data,omitempty"` + Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"` // Used to facilitate programatic handling of secret data. - Type SecretType `json:"type,omitempty"` + Type SecretType `json:"type,omitempty" description:"type facilitates programmatic handling of secret data"` } const MaxSecretSize = 1 * 1024 * 1024 @@ -1269,5 +1273,5 @@ type SecretList struct { TypeMeta `json:",inline"` ListMeta `json:"metadata,omitempty"` - Items []Secret `json:"items"` + Items []Secret `json:"items" description:"items is a list of secret objects"` }