Skip to content

Commit 15e2bc1

Browse files
authoredJan 26, 2018
Merge pull request #439 from roycaihw/master
Api change v1beta2 adding required controller spec selector fields
2 parents 9e982cb + 284e9d0 commit 15e2bc1

10 files changed

+38
-25
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v5.0.0b1
2+
- Label selector for pods is now required and must match the pod template's labels for v1beta2 StatefulSetSpec, ReplicaSetSpec, DaemonSetSpec and DeploymentSpec kubernetes/kubernetes#55357
3+
14
# v4.0.0
25
- api change V1PersistentVolumeSpec to V1ScaleIOPersistentVolumeSource #397.
36

‎kubernetes/client/models/v1beta2_daemon_set_spec.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ def __init__(self, min_ready_seconds=None, revision_history_limit=None, selector
6262
self.min_ready_seconds = min_ready_seconds
6363
if revision_history_limit is not None:
6464
self.revision_history_limit = revision_history_limit
65-
if selector is not None:
66-
self.selector = selector
65+
self.selector = selector
6766
self.template = template
6867
if update_strategy is not None:
6968
self.update_strategy = update_strategy
@@ -118,7 +117,7 @@ def revision_history_limit(self, revision_history_limit):
118117
def selector(self):
119118
"""
120119
Gets the selector of this V1beta2DaemonSetSpec.
121-
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
120+
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
122121
123122
:return: The selector of this V1beta2DaemonSetSpec.
124123
:rtype: V1LabelSelector
@@ -129,11 +128,13 @@ def selector(self):
129128
def selector(self, selector):
130129
"""
131130
Sets the selector of this V1beta2DaemonSetSpec.
132-
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
131+
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
133132
134133
:param selector: The selector of this V1beta2DaemonSetSpec.
135134
:type: V1LabelSelector
136135
"""
136+
if selector is None:
137+
raise ValueError("Invalid value for `selector`, must not be `None`")
137138

138139
self._selector = selector
139140

‎kubernetes/client/models/v1beta2_deployment_spec.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ def __init__(self, min_ready_seconds=None, paused=None, progress_deadline_second
7777
self.replicas = replicas
7878
if revision_history_limit is not None:
7979
self.revision_history_limit = revision_history_limit
80-
if selector is not None:
81-
self.selector = selector
80+
self.selector = selector
8281
if strategy is not None:
8382
self.strategy = strategy
8483
self.template = template
@@ -202,7 +201,7 @@ def revision_history_limit(self, revision_history_limit):
202201
def selector(self):
203202
"""
204203
Gets the selector of this V1beta2DeploymentSpec.
205-
Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
204+
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.
206205
207206
:return: The selector of this V1beta2DeploymentSpec.
208207
:rtype: V1LabelSelector
@@ -213,11 +212,13 @@ def selector(self):
213212
def selector(self, selector):
214213
"""
215214
Sets the selector of this V1beta2DeploymentSpec.
216-
Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
215+
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.
217216
218217
:param selector: The selector of this V1beta2DeploymentSpec.
219218
:type: V1LabelSelector
220219
"""
220+
if selector is None:
221+
raise ValueError("Invalid value for `selector`, must not be `None`")
221222

222223
self._selector = selector
223224

‎kubernetes/client/models/v1beta2_replica_set_spec.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def __init__(self, min_ready_seconds=None, replicas=None, selector=None, templat
5959
self.min_ready_seconds = min_ready_seconds
6060
if replicas is not None:
6161
self.replicas = replicas
62-
if selector is not None:
63-
self.selector = selector
62+
self.selector = selector
6463
if template is not None:
6564
self.template = template
6665

@@ -114,7 +113,7 @@ def replicas(self, replicas):
114113
def selector(self):
115114
"""
116115
Gets the selector of this V1beta2ReplicaSetSpec.
117-
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
116+
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
118117
119118
:return: The selector of this V1beta2ReplicaSetSpec.
120119
:rtype: V1LabelSelector
@@ -125,11 +124,13 @@ def selector(self):
125124
def selector(self, selector):
126125
"""
127126
Sets the selector of this V1beta2ReplicaSetSpec.
128-
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
127+
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
129128
130129
:param selector: The selector of this V1beta2ReplicaSetSpec.
131130
:type: V1LabelSelector
132131
"""
132+
if selector is None:
133+
raise ValueError("Invalid value for `selector`, must not be `None`")
133134

134135
self._selector = selector
135136

‎kubernetes/client/models/v1beta2_stateful_set_spec.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def __init__(self, pod_management_policy=None, replicas=None, revision_history_l
7373
self.replicas = replicas
7474
if revision_history_limit is not None:
7575
self.revision_history_limit = revision_history_limit
76-
if selector is not None:
77-
self.selector = selector
76+
self.selector = selector
7877
self.service_name = service_name
7978
self.template = template
8079
if update_strategy is not None:
@@ -155,7 +154,7 @@ def revision_history_limit(self, revision_history_limit):
155154
def selector(self):
156155
"""
157156
Gets the selector of this V1beta2StatefulSetSpec.
158-
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
157+
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
159158
160159
:return: The selector of this V1beta2StatefulSetSpec.
161160
:rtype: V1LabelSelector
@@ -166,11 +165,13 @@ def selector(self):
166165
def selector(self, selector):
167166
"""
168167
Sets the selector of this V1beta2StatefulSetSpec.
169-
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
168+
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
170169
171170
:param selector: The selector of this V1beta2StatefulSetSpec.
172171
:type: V1LabelSelector
173172
"""
173+
if selector is None:
174+
raise ValueError("Invalid value for `selector`, must not be `None`")
174175

175176
self._selector = selector
176177

‎kubernetes/docs/V1beta2DaemonSetSpec.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**min_ready_seconds** | **int** | 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). | [optional]
77
**revision_history_limit** | **int** | The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. | [optional]
8-
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 | [optional]
8+
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 |
99
**template** | [**V1PodTemplateSpec**](V1PodTemplateSpec.md) | 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 |
1010
**update_strategy** | [**V1beta2DaemonSetUpdateStrategy**](V1beta2DaemonSetUpdateStrategy.md) | An update strategy to replace existing DaemonSet pods with new pods. | [optional]
1111

‎kubernetes/docs/V1beta2DeploymentSpec.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
**progress_deadline_seconds** | **int** | The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. | [optional]
99
**replicas** | **int** | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. | [optional]
1010
**revision_history_limit** | **int** | The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. | [optional]
11-
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. | [optional]
11+
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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. |
1212
**strategy** | [**V1beta2DeploymentStrategy**](V1beta2DeploymentStrategy.md) | The deployment strategy to use to replace existing pods with new ones. | [optional]
1313
**template** | [**V1PodTemplateSpec**](V1PodTemplateSpec.md) | Template describes the pods that will be created. |
1414

‎kubernetes/docs/V1beta2ReplicaSetSpec.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**min_ready_seconds** | **int** | 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) | [optional]
77
**replicas** | **int** | 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 | [optional]
8-
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 | [optional]
8+
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 |
99
**template** | [**V1PodTemplateSpec**](V1PodTemplateSpec.md) | 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 | [optional]
1010

1111
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

‎kubernetes/docs/V1beta2StatefulSetSpec.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
**pod_management_policy** | **str** | podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once. | [optional]
77
**replicas** | **int** | 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. | [optional]
88
**revision_history_limit** | **int** | revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. | [optional]
9-
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 | [optional]
9+
**selector** | [**V1LabelSelector**](V1LabelSelector.md) | 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 |
1010
**service_name** | **str** | 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. |
1111
**template** | [**V1PodTemplateSpec**](V1PodTemplateSpec.md) | 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. |
1212
**update_strategy** | [**V1beta2StatefulSetUpdateStrategy**](V1beta2StatefulSetUpdateStrategy.md) | updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. | [optional]

0 commit comments

Comments
 (0)