Skip to content

Commit e99c2b6

Browse files
Merge pull request #55357 from crimsonfaith91/doc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. update apps/v1 types.go comments for controller spec selector fields **What this PR does / why we need it**: This PR updates apps/v1 types.go comments (including removal of `optional` tag) for controller spec selector fields. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: xref #50808 **Release note**: ```release-note NONE ``` Kubernetes-commit: 5f43fc8c8d82e059ed764b1b3faee580e555358f
2 parents 546d034 + b0d0f66 commit e99c2b6

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

apps/v1/generated.proto

Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/v1/types.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ type StatefulSetSpec struct {
121121
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
122122

123123
// selector is a label query over pods that should match the replica count.
124-
// If empty, defaulted to labels on the pod template.
124+
// It must match the pod template's labels.
125125
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
126-
// +optional
127-
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
126+
Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"`
128127

129128
// template is the object that describes the pod that will be created if
130129
// insufficient replicas are detected. Each pod stamped out by the StatefulSet
@@ -271,8 +270,8 @@ type DeploymentSpec struct {
271270

272271
// Label selector for pods. Existing ReplicaSets whose pods are
273272
// selected by this will be the ones affected by this deployment.
274-
// +optional
275-
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
273+
// It must match the pod template's labels.
274+
Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"`
276275

277276
// Template describes the pods that will be created.
278277
Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
@@ -502,10 +501,9 @@ type RollingUpdateDaemonSet struct {
502501
type DaemonSetSpec struct {
503502
// A label query over pods that are managed by the daemon set.
504503
// Must match in order to be controlled.
505-
// If empty, defaulted to labels on Pod template.
504+
// It must match the pod template's labels.
506505
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
507-
// +optional
508-
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
506+
Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"`
509507

510508
// An object that describes the pod that will be created.
511509
// The DaemonSet will create exactly one copy of this pod on every node
@@ -711,11 +709,10 @@ type ReplicaSetSpec struct {
711709
MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
712710

713711
// Selector is a label query over pods that should match the replica count.
714-
// If the selector is empty, it is defaulted to the labels present on the pod template.
715712
// Label keys and values that must match in order to be controlled by this replica set.
713+
// It must match the pod template's labels.
716714
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
717-
// +optional
718-
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
715+
Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"`
719716

720717
// Template is the object that describes the pod that will be created if
721718
// insufficient replicas are detected.

apps/v1/types_swagger_doc_generated.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (DaemonSetList) SwaggerDoc() map[string]string {
8484

8585
var map_DaemonSetSpec = map[string]string{
8686
"": "DaemonSetSpec is the specification of a daemon set.",
87-
"selector": "A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
87+
"selector": "A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
8888
"template": "An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template",
8989
"updateStrategy": "An update strategy to replace existing DaemonSet pods with new pods.",
9090
"minReadySeconds": "The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).",
@@ -161,7 +161,7 @@ func (DeploymentList) SwaggerDoc() map[string]string {
161161
var map_DeploymentSpec = map[string]string{
162162
"": "DeploymentSpec is the specification of the desired behavior of the Deployment.",
163163
"replicas": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.",
164-
"selector": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.",
164+
"selector": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.",
165165
"template": "Template describes the pods that will be created.",
166166
"strategy": "The deployment strategy to use to replace existing pods with new ones.",
167167
"minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)",
@@ -238,7 +238,7 @@ var map_ReplicaSetSpec = map[string]string{
238238
"": "ReplicaSetSpec is the specification of a ReplicaSet.",
239239
"replicas": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller",
240240
"minReadySeconds": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)",
241-
"selector": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
241+
"selector": "Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
242242
"template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template",
243243
}
244244

@@ -322,7 +322,7 @@ func (StatefulSetList) SwaggerDoc() map[string]string {
322322
var map_StatefulSetSpec = map[string]string{
323323
"": "A StatefulSetSpec is the specification of a StatefulSet.",
324324
"replicas": "replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.",
325-
"selector": "selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
325+
"selector": "selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
326326
"template": "template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet.",
327327
"volumeClaimTemplates": "volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.",
328328
"serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.",

0 commit comments

Comments
 (0)