Skip to content

Commit

Permalink
Api change v1beta2 adding required controller spec selector fields
Browse files Browse the repository at this point in the history
  • Loading branch information
roycaihw committed Jan 25, 2018
1 parent 9e982cb commit 284e9d0
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 25 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v5.0.0b1
- 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

# v4.0.0
- api change V1PersistentVolumeSpec to V1ScaleIOPersistentVolumeSource #397.

Expand Down
9 changes: 5 additions & 4 deletions kubernetes/client/models/v1beta2_daemon_set_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def __init__(self, min_ready_seconds=None, revision_history_limit=None, selector
self.min_ready_seconds = min_ready_seconds
if revision_history_limit is not None:
self.revision_history_limit = revision_history_limit
if selector is not None:
self.selector = selector
self.selector = selector
self.template = template
if update_strategy is not None:
self.update_strategy = update_strategy
Expand Down Expand Up @@ -118,7 +117,7 @@ def revision_history_limit(self, revision_history_limit):
def selector(self):
"""
Gets the selector of this V1beta2DaemonSetSpec.
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
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
:return: The selector of this V1beta2DaemonSetSpec.
:rtype: V1LabelSelector
Expand All @@ -129,11 +128,13 @@ def selector(self):
def selector(self, selector):
"""
Sets the selector of this V1beta2DaemonSetSpec.
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
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
:param selector: The selector of this V1beta2DaemonSetSpec.
:type: V1LabelSelector
"""
if selector is None:
raise ValueError("Invalid value for `selector`, must not be `None`")

self._selector = selector

Expand Down
9 changes: 5 additions & 4 deletions kubernetes/client/models/v1beta2_deployment_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def __init__(self, min_ready_seconds=None, paused=None, progress_deadline_second
self.replicas = replicas
if revision_history_limit is not None:
self.revision_history_limit = revision_history_limit
if selector is not None:
self.selector = selector
self.selector = selector
if strategy is not None:
self.strategy = strategy
self.template = template
Expand Down Expand Up @@ -202,7 +201,7 @@ def revision_history_limit(self, revision_history_limit):
def selector(self):
"""
Gets the selector of this V1beta2DeploymentSpec.
Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
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.
:return: The selector of this V1beta2DeploymentSpec.
:rtype: V1LabelSelector
Expand All @@ -213,11 +212,13 @@ def selector(self):
def selector(self, selector):
"""
Sets the selector of this V1beta2DeploymentSpec.
Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
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.
:param selector: The selector of this V1beta2DeploymentSpec.
:type: V1LabelSelector
"""
if selector is None:
raise ValueError("Invalid value for `selector`, must not be `None`")

self._selector = selector

Expand Down
9 changes: 5 additions & 4 deletions kubernetes/client/models/v1beta2_replica_set_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def __init__(self, min_ready_seconds=None, replicas=None, selector=None, templat
self.min_ready_seconds = min_ready_seconds
if replicas is not None:
self.replicas = replicas
if selector is not None:
self.selector = selector
self.selector = selector
if template is not None:
self.template = template

Expand Down Expand Up @@ -114,7 +113,7 @@ def replicas(self, replicas):
def selector(self):
"""
Gets the selector of this V1beta2ReplicaSetSpec.
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
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
:return: The selector of this V1beta2ReplicaSetSpec.
:rtype: V1LabelSelector
Expand All @@ -125,11 +124,13 @@ def selector(self):
def selector(self, selector):
"""
Sets the selector of this V1beta2ReplicaSetSpec.
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
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
:param selector: The selector of this V1beta2ReplicaSetSpec.
:type: V1LabelSelector
"""
if selector is None:
raise ValueError("Invalid value for `selector`, must not be `None`")

self._selector = selector

Expand Down
9 changes: 5 additions & 4 deletions kubernetes/client/models/v1beta2_stateful_set_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def __init__(self, pod_management_policy=None, replicas=None, revision_history_l
self.replicas = replicas
if revision_history_limit is not None:
self.revision_history_limit = revision_history_limit
if selector is not None:
self.selector = selector
self.selector = selector
self.service_name = service_name
self.template = template
if update_strategy is not None:
Expand Down Expand Up @@ -155,7 +154,7 @@ def revision_history_limit(self, revision_history_limit):
def selector(self):
"""
Gets the selector of this V1beta2StatefulSetSpec.
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
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
:return: The selector of this V1beta2StatefulSetSpec.
:rtype: V1LabelSelector
Expand All @@ -166,11 +165,13 @@ def selector(self):
def selector(self, selector):
"""
Sets the selector of this V1beta2StatefulSetSpec.
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
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
:param selector: The selector of this V1beta2StatefulSetSpec.
:type: V1LabelSelector
"""
if selector is None:
raise ValueError("Invalid value for `selector`, must not be `None`")

self._selector = selector

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/docs/V1beta2DaemonSetSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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]
**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]
**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]
**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 |
**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 |
**update_strategy** | [**V1beta2DaemonSetUpdateStrategy**](V1beta2DaemonSetUpdateStrategy.md) | An update strategy to replace existing DaemonSet pods with new pods. | [optional]

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/docs/V1beta2DeploymentSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**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]
**replicas** | **int** | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. | [optional]
**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]
**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]
**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. |
**strategy** | [**V1beta2DeploymentStrategy**](V1beta2DeploymentStrategy.md) | The deployment strategy to use to replace existing pods with new ones. | [optional]
**template** | [**V1PodTemplateSpec**](V1PodTemplateSpec.md) | Template describes the pods that will be created. |

Expand Down
2 changes: 1 addition & 1 deletion kubernetes/docs/V1beta2ReplicaSetSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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]
**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]
**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]
**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 |
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/docs/V1beta2StatefulSetSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
**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]
**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]
**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]
**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]
**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 |
**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. |
**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. |
**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]
Expand Down
Loading

0 comments on commit 284e9d0

Please sign in to comment.