diff --git a/CHANGELOG.md b/CHANGELOG.md index c670733df1..0e27cd16da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v6.0.0b1 +- Update to Kubernetes 1.10 cluster +- New API: add PATCH to CustomObjectsApi [kubernetes-client/gen#53](https://github.com/kubernetes-client/gen/pull/53) +- Documentation update: never let cluster-scoped resources skip webhooks [kubernetes/kubernetes#58185](https://github.com/kubernetes/kubernetes/pull/58185) + # v5.0.0 - No changes. The same as `v5.0.0b1`. diff --git a/README.md b/README.md index 9b423deaf4..15938c2a18 100644 --- a/README.md +++ b/README.md @@ -83,14 +83,15 @@ supported versions of Kubernetes clusters. #### Compatibility matrix -| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | -|--------------------|----------------|----------------|----------------|----------------|----------------|----------------| -| client-python 1.0 | + | ✓ | - | - |- |- | -| client-python 2.0 | + | + | ✓ | - |- |- | -| client-python 3.0 | + | + | + | ✓ |- |- | -| client-python 4.0 | + | + | + | + |✓ |- | -| client-python 5.0 | + | + | + | + |+ |✓ | -| client-python HEAD | + | + | + | + |+ |✓ | +| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 | +|--------------------|----------------|----------------|----------------|----------------|----------------|----------------|-----------------| +| client-python 1.0 | + | ✓ | - | - |- |- | | +| client-python 2.0 | + | + | ✓ | - |- |- | | +| client-python 3.0 | + | + | + | ✓ |- |- | | +| client-python 4.0 | + | + | + | + |✓ |- | | +| client-python 5.0 | + | + | + | + |+ |✓ | | +| client-python 6.0 | + | + | + | + |+ |+ |✓ | +| client-python HEAD | + | + | + | + |+ |+ |✓ | Key: @@ -116,6 +117,7 @@ between client-python versions. | 4.0 | Kubernetes main repo, 1.8 branch | ✓ | | 5.0 Alpha/Beta | Kubernetes main repo, 1.9 branch | ✗ | | 5.0 | Kubernetes main repo, 1.9 branch | ✓ | +| 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch | ✓ | Key: diff --git a/kubernetes/README.md b/kubernetes/README.md index 81b8c89b1c..605eded183 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -618,6 +618,8 @@ Class | Method | HTTP request | Description *CustomObjectsApi* | [**get_namespaced_custom_object**](docs/CustomObjectsApi.md#get_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | *CustomObjectsApi* | [**list_cluster_custom_object**](docs/CustomObjectsApi.md#list_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural} | *CustomObjectsApi* | [**list_namespaced_custom_object**](docs/CustomObjectsApi.md#list_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} | +*CustomObjectsApi* | [**patch_cluster_custom_object**](docs/CustomObjectsApi.md#patch_cluster_custom_object) | **PATCH** /apis/{group}/{version}/{plural}/{name} | +*CustomObjectsApi* | [**patch_namespaced_custom_object**](docs/CustomObjectsApi.md#patch_namespaced_custom_object) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | *CustomObjectsApi* | [**replace_cluster_custom_object**](docs/CustomObjectsApi.md#replace_cluster_custom_object) | **PUT** /apis/{group}/{version}/{plural}/{name} | *CustomObjectsApi* | [**replace_namespaced_custom_object**](docs/CustomObjectsApi.md#replace_namespaced_custom_object) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | *EventsApi* | [**get_api_group**](docs/EventsApi.md#get_api_group) | **GET** /apis/events.k8s.io/ | diff --git a/kubernetes/client/apis/custom_objects_api.py b/kubernetes/client/apis/custom_objects_api.py index 627af34ef2..e3d41d45a2 100644 --- a/kubernetes/client/apis/custom_objects_api.py +++ b/kubernetes/client/apis/custom_objects_api.py @@ -1055,6 +1055,261 @@ def list_namespaced_custom_object_with_http_info(self, group, version, namespace _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def patch_cluster_custom_object(self, group, version, plural, name, body, **kwargs): + """ + patch the specified cluster scoped custom object + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.patch_cluster_custom_object(group, version, plural, name, body, async=True) + >>> result = thread.get() + + :param async bool + :param str group: the custom resource's group (required) + :param str version: the custom resource's version (required) + :param str plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :param str name: the custom object's name (required) + :param object body: The JSON schema of the Resource to patch. (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs) + else: + (data) = self.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs) + return data + + def patch_cluster_custom_object_with_http_info(self, group, version, plural, name, body, **kwargs): + """ + patch the specified cluster scoped custom object + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, async=True) + >>> result = thread.get() + + :param async bool + :param str group: the custom resource's group (required) + :param str version: the custom resource's version (required) + :param str plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :param str name: the custom object's name (required) + :param object body: The JSON schema of the Resource to patch. (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group', 'version', 'plural', 'name', 'body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_custom_object" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group' is set + if ('group' not in params) or (params['group'] is None): + raise ValueError("Missing the required parameter `group` when calling `patch_cluster_custom_object`") + # verify the required parameter 'version' is set + if ('version' not in params) or (params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `patch_cluster_custom_object`") + # verify the required parameter 'plural' is set + if ('plural' not in params) or (params['plural'] is None): + raise ValueError("Missing the required parameter `plural` when calling `patch_cluster_custom_object`") + # verify the required parameter 'name' is set + if ('name' not in params) or (params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `patch_cluster_custom_object`") + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `patch_cluster_custom_object`") + + + collection_formats = {} + + path_params = {} + if 'group' in params: + path_params['group'] = params['group'] + if 'version' in params: + path_params['version'] = params['version'] + if 'plural' in params: + path_params['plural'] = params['plural'] + if 'name' in params: + path_params['name'] = params['name'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/merge-patch+json']) + + # Authentication setting + auth_settings = ['BearerToken'] + + return self.api_client.call_api('/apis/{group}/{version}/{plural}/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def patch_namespaced_custom_object(self, group, version, namespace, plural, name, body, **kwargs): + """ + patch the specified namespace scoped custom object + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.patch_namespaced_custom_object(group, version, namespace, plural, name, body, async=True) + >>> result = thread.get() + + :param async bool + :param str group: the custom resource's group (required) + :param str version: the custom resource's version (required) + :param str namespace: The custom resource's namespace (required) + :param str plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :param str name: the custom object's name (required) + :param object body: The JSON schema of the Resource to patch. (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs) + else: + (data) = self.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs) + return data + + def patch_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): + """ + patch the specified namespace scoped custom object + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, async=True) + >>> result = thread.get() + + :param async bool + :param str group: the custom resource's group (required) + :param str version: the custom resource's version (required) + :param str namespace: The custom resource's namespace (required) + :param str plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :param str name: the custom object's name (required) + :param object body: The JSON schema of the Resource to patch. (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group', 'version', 'namespace', 'plural', 'name', 'body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_custom_object" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group' is set + if ('group' not in params) or (params['group'] is None): + raise ValueError("Missing the required parameter `group` when calling `patch_namespaced_custom_object`") + # verify the required parameter 'version' is set + if ('version' not in params) or (params['version'] is None): + raise ValueError("Missing the required parameter `version` when calling `patch_namespaced_custom_object`") + # verify the required parameter 'namespace' is set + if ('namespace' not in params) or (params['namespace'] is None): + raise ValueError("Missing the required parameter `namespace` when calling `patch_namespaced_custom_object`") + # verify the required parameter 'plural' is set + if ('plural' not in params) or (params['plural'] is None): + raise ValueError("Missing the required parameter `plural` when calling `patch_namespaced_custom_object`") + # verify the required parameter 'name' is set + if ('name' not in params) or (params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `patch_namespaced_custom_object`") + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_custom_object`") + + + collection_formats = {} + + path_params = {} + if 'group' in params: + path_params['group'] = params['group'] + if 'version' in params: + path_params['version'] = params['version'] + if 'namespace' in params: + path_params['namespace'] = params['namespace'] + if 'plural' in params: + path_params['plural'] = params['plural'] + if 'name' in params: + path_params['name'] = params['name'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/merge-patch+json']) + + # Authentication setting + auth_settings = ['BearerToken'] + + return self.api_client.call_api('/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def replace_cluster_custom_object(self, group, version, plural, name, body, **kwargs): """ replace the specified cluster scoped custom object diff --git a/kubernetes/client/models/v1beta1_webhook.py b/kubernetes/client/models/v1beta1_webhook.py index 8dcce76f31..05bd1014c6 100644 --- a/kubernetes/client/models/v1beta1_webhook.py +++ b/kubernetes/client/models/v1beta1_webhook.py @@ -144,7 +144,7 @@ def name(self, name): def namespace_selector(self): """ Gets the namespace_selector of this V1beta1Webhook. - NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. + NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. :return: The namespace_selector of this V1beta1Webhook. :rtype: V1LabelSelector @@ -155,7 +155,7 @@ def namespace_selector(self): def namespace_selector(self, namespace_selector): """ Sets the namespace_selector of this V1beta1Webhook. - NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. + NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. :param namespace_selector: The namespace_selector of this V1beta1Webhook. :type: V1LabelSelector diff --git a/kubernetes/docs/CustomObjectsApi.md b/kubernetes/docs/CustomObjectsApi.md index 54ffb1c593..ff17fcad4d 100644 --- a/kubernetes/docs/CustomObjectsApi.md +++ b/kubernetes/docs/CustomObjectsApi.md @@ -12,6 +12,8 @@ Method | HTTP request | Description [**get_namespaced_custom_object**](CustomObjectsApi.md#get_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | [**list_cluster_custom_object**](CustomObjectsApi.md#list_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural} | [**list_namespaced_custom_object**](CustomObjectsApi.md#list_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} | +[**patch_cluster_custom_object**](CustomObjectsApi.md#patch_cluster_custom_object) | **PATCH** /apis/{group}/{version}/{plural}/{name} | +[**patch_namespaced_custom_object**](CustomObjectsApi.md#patch_namespaced_custom_object) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | [**replace_cluster_custom_object**](CustomObjectsApi.md#replace_cluster_custom_object) | **PUT** /apis/{group}/{version}/{plural}/{name} | [**replace_namespaced_custom_object**](CustomObjectsApi.md#replace_namespaced_custom_object) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | @@ -528,6 +530,130 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **patch_cluster_custom_object** +> object patch_cluster_custom_object(group, version, plural, name, body) + + + +patch the specified cluster scoped custom object + +### Example +```python +from __future__ import print_function +import time +import kubernetes.client +from kubernetes.client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: BearerToken +configuration = kubernetes.client.Configuration() +configuration.api_key['authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = kubernetes.client.CustomObjectsApi(kubernetes.client.ApiClient(configuration)) +group = 'group_example' # str | the custom resource's group +version = 'version_example' # str | the custom resource's version +plural = 'plural_example' # str | the custom object's plural name. For TPRs this would be lowercase plural kind. +name = 'name_example' # str | the custom object's name +body = NULL # object | The JSON schema of the Resource to patch. + +try: + api_response = api_instance.patch_cluster_custom_object(group, version, plural, name, body) + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomObjectsApi->patch_cluster_custom_object: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| the custom resource's group | + **version** | **str**| the custom resource's version | + **plural** | **str**| the custom object's plural name. For TPRs this would be lowercase plural kind. | + **name** | **str**| the custom object's name | + **body** | **object**| The JSON schema of the Resource to patch. | + +### Return type + +**object** + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/merge-patch+json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **patch_namespaced_custom_object** +> object patch_namespaced_custom_object(group, version, namespace, plural, name, body) + + + +patch the specified namespace scoped custom object + +### Example +```python +from __future__ import print_function +import time +import kubernetes.client +from kubernetes.client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: BearerToken +configuration = kubernetes.client.Configuration() +configuration.api_key['authorization'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['authorization'] = 'Bearer' + +# create an instance of the API class +api_instance = kubernetes.client.CustomObjectsApi(kubernetes.client.ApiClient(configuration)) +group = 'group_example' # str | the custom resource's group +version = 'version_example' # str | the custom resource's version +namespace = 'namespace_example' # str | The custom resource's namespace +plural = 'plural_example' # str | the custom resource's plural name. For TPRs this would be lowercase plural kind. +name = 'name_example' # str | the custom object's name +body = NULL # object | The JSON schema of the Resource to patch. + +try: + api_response = api_instance.patch_namespaced_custom_object(group, version, namespace, plural, name, body) + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomObjectsApi->patch_namespaced_custom_object: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| the custom resource's group | + **version** | **str**| the custom resource's version | + **namespace** | **str**| The custom resource's namespace | + **plural** | **str**| the custom resource's plural name. For TPRs this would be lowercase plural kind. | + **name** | **str**| the custom object's name | + **body** | **object**| The JSON schema of the Resource to patch. | + +### Return type + +**object** + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: application/merge-patch+json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **replace_cluster_custom_object** > object replace_cluster_custom_object(group, version, plural, name, body) diff --git a/kubernetes/docs/V1beta1Webhook.md b/kubernetes/docs/V1beta1Webhook.md index 6c9361938e..3aa5e5b30d 100644 --- a/kubernetes/docs/V1beta1Webhook.md +++ b/kubernetes/docs/V1beta1Webhook.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **kubernetes.client_config** | [**V1beta1WebhookClientConfig**](V1beta1WebhookClientConfig.md) | ClientConfig defines how to communicate with the hook. Required | **failure_policy** | **str** | FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Ignore. | [optional] **name** | **str** | The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required. | -**namespace_selector** | [**V1LabelSelector**](V1LabelSelector.md) | NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. | [optional] +**namespace_selector** | [**V1LabelSelector**](V1LabelSelector.md) | NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook. For example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"runlevel\", \"operator\": \"NotIn\", \"values\": [ \"0\", \"1\" ] } ] } If instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": { \"matchExpressions\": [ { \"key\": \"environment\", \"operator\": \"In\", \"values\": [ \"prod\", \"staging\" ] } ] } See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors. Default to the empty LabelSelector, which matches everything. | [optional] **rules** | [**list[V1beta1RuleWithOperations]**](V1beta1RuleWithOperations.md) | Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. | [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) diff --git a/kubernetes/swagger.json.unprocessed b/kubernetes/swagger.json.unprocessed index 45d60d6a86..aee243a545 100644 --- a/kubernetes/swagger.json.unprocessed +++ b/kubernetes/swagger.json.unprocessed @@ -69812,7 +69812,7 @@ "type": "string" }, "namespaceSelector": { - "description": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", + "description": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" }, "rules": { diff --git a/kubernetes/test/test_custom_objects_api.py b/kubernetes/test/test_custom_objects_api.py index 1048cabf9c..d9cac518e5 100644 --- a/kubernetes/test/test_custom_objects_api.py +++ b/kubernetes/test/test_custom_objects_api.py @@ -92,6 +92,22 @@ def test_list_namespaced_custom_object(self): Test case for list_namespaced_custom_object + """ + pass + + def test_patch_cluster_custom_object(self): + """ + Test case for patch_cluster_custom_object + + + """ + pass + + def test_patch_namespaced_custom_object(self): + """ + Test case for patch_namespaced_custom_object + + """ pass diff --git a/scripts/swagger.json b/scripts/swagger.json index 13084bc946..9a7d1baca2 100644 --- a/scripts/swagger.json +++ b/scripts/swagger.json @@ -63402,6 +63402,44 @@ ], "operationId": "replaceClusterCustomObject" }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "patch the specified cluster scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "description": "The JSON schema of the Resource to patch.", + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchClusterCustomObject" + }, "delete": { "responses": { "200": { @@ -63557,6 +63595,44 @@ ], "operationId": "replaceNamespacedCustomObject" }, + "patch": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + }, + "schemes": [ + "https" + ], + "description": "patch the specified namespace scoped custom object", + "parameters": [ + { + "schema": { + "type": "object" + }, + "description": "The JSON schema of the Resource to patch.", + "required": true, + "name": "body", + "in": "body" + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "custom_objects" + ], + "consumes": [ + "application/merge-patch+json" + ], + "operationId": "patchNamespacedCustomObject" + }, "delete": { "responses": { "200": { @@ -71996,7 +72072,7 @@ "type": "string" }, "namespaceSelector": { - "description": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", + "description": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", "$ref": "#/definitions/v1.LabelSelector" }, "rules": {