-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Add doc in types.go for hooks/description.sh #4680
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 |
---|---|---|
|
@@ -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://<container_id>'"` | ||
} | ||
|
||
// 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 | ||
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. Do we need the comments, since we have the descriptions? 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 just added for consistency. 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. Ok, though I don't think we're very consistent about it, and it just creates 2 things to update and keep in sync. |
||
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"` | ||
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 usually put 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 that I'd eliminate the field name from the description. 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 don't have a ton more time to refine this today, so if the goal is to enable the script to not allow more deviation, then this should be good to go. We can nit text later I guess. 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. Ok, fine. |
||
|
||
// 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"` | ||
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 would omit "status describes" |
||
} | ||
|
||
// 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,33 +1021,33 @@ 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"` | ||
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. Omit "limits is the". |
||
} | ||
|
||
// LimitRange sets resource usage limits for each kind of resource in a Namespace | ||
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"` | ||
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. How about "resource limits enforced" |
||
} | ||
|
||
// LimitRangeList is a list of LimitRange items. | ||
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,26 +1065,26 @@ 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"` | ||
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. Omit "hard is the" |
||
// 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"` | ||
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. Omit "used is the" 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. Anyway, you get the idea. Omit the field name, "is", and "the". "Defines"/"specifies" and "describes" might sometimes be appropriate to distinguish spec and status, but might not always be necessary. |
||
} | ||
|
||
// ResourceQuota sets aggregate quota restrictions enforced per namespace | ||
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,15 +1093,15 @@ 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 | ||
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"` | ||
} |
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.
Thanks. We'll merge the PR to fix the Travis check right after we merge this PR so more of these don't get merged.
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 "reference to a secret object"