diff --git a/Dockerfile b/Dockerfile index c5fd813..3bb7edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,13 @@ FROM python:3.11-slim-bookworm COPY target/dist/kubernator*/dist/*.whl /tmp ENV DEBIAN_FRONTEND=noninteractive -RUN pip install --no-input --no-cache-dir /tmp/*.whl && \ +WORKDIR /root + +RUN pip install --no-input /tmp/*.whl && \ apt update && apt install git -y && \ + kubernator --pre-cache-k8s-client $(seq 19 28) && \ + pip cache purge && \ rm -rf /var/lib/{apt,dpkg,cache,log}/ && \ rm -rf /tmp/* -WORKDIR /root -RUN kubernator --pre-cache-k8s-client $(seq 19 28) ENTRYPOINT ["/usr/local/bin/kubernator"] diff --git a/build.py b/build.py index db29163..01c2f4e 100644 --- a/build.py +++ b/build.py @@ -27,7 +27,7 @@ use_plugin("filter_resources") name = "kubernator" -version = "1.0.12" +version = "1.0.13.dev" summary = "Kubernator is the a pluggable framework for K8S provisioning" authors = [Author("Express Systems USA, Inc.", "")] @@ -61,6 +61,7 @@ def set_properties(project): project.depends_on("jinja2", "~=3.1") project.depends_on("coloredlogs", "~=15.0") project.depends_on("jsonschema", "<4.0") + project.depends_on("diff-match-patch", ">2023.0") project.set_property("coverage_break_build", False) project.set_property("cram_fail_if_no_tests", False) diff --git a/src/integrationtest/python/issue_35/.kubernator.py b/src/integrationtest/python/issue_35/crd/.kubernator.py similarity index 80% rename from src/integrationtest/python/issue_35/.kubernator.py rename to src/integrationtest/python/issue_35/crd/.kubernator.py index ccc709b..7a55d2c 100644 --- a/src/integrationtest/python/issue_35/.kubernator.py +++ b/src/integrationtest/python/issue_35/crd/.kubernator.py @@ -3,7 +3,7 @@ ktor.app.register_plugin("minikube", k8s_version=os.environ["K8S_VERSION"], start_fresh=os.environ["START_FRESH"], - keep_running=os.environ["KEEP_RUNNING"], profile="issue-35") + keep_running=True, profile="issue-35") ktor.app.register_plugin("k8s", field_validation=os.environ["FIELD_VALIDATION"], field_validation_warn_fatal=os.environ["WARN_FATAL"]) diff --git a/src/integrationtest/python/issue_35/crd/manifests.yaml b/src/integrationtest/python/issue_35/crd/manifests.yaml new file mode 100644 index 0000000..7500743 --- /dev/null +++ b/src/integrationtest/python/issue_35/crd/manifests.yaml @@ -0,0 +1,40 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + # name must match the spec fields below, and be in the form: . + name: crontabs.stable.example.com +spec: + # group name to use for REST API: /apis// + group: stable.example.com + # list of versions supported by this CustomResourceDefinition + versions: + - name: v1 + # Each version can be enabled/disabled by Served flag. + served: true + # One and only one version must be marked as the storage version. + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + cronSpec: + type: string + image: + type: string + replicas: + type: integer + # either Namespaced or Cluster + scope: Namespaced + names: + # plural name to be used in the URL: /apis/// + plural: crontabs + # singular name to be used as an alias on the CLI and for display + singular: crontab + # kind is normally the CamelCased singular type. Your resource manifests use this. + kind: CronTab + # shortNames allow shorter string to match your resource on the CLI + shortNames: + - ct diff --git a/src/integrationtest/python/issue_35/test/.kubernator.py b/src/integrationtest/python/issue_35/test/.kubernator.py new file mode 100644 index 0000000..c8120fb --- /dev/null +++ b/src/integrationtest/python/issue_35/test/.kubernator.py @@ -0,0 +1,10 @@ +# flake8: noqa +import os + +ktor.app.register_plugin("minikube", k8s_version=os.environ["K8S_VERSION"], + start_fresh=False, + keep_running=os.environ["KEEP_RUNNING"], profile="issue-35") +ktor.app.register_plugin("k8s", + field_validation=os.environ["FIELD_VALIDATION"], + field_validation_warn_fatal=os.environ["WARN_FATAL"]) +ktor.k8s.load_crds(ktor.app.cwd / ".." / "crd" / "manifests.yaml", "yaml") diff --git a/src/integrationtest/python/issue_35/manifests.yaml b/src/integrationtest/python/issue_35/test/manifests.yaml similarity index 61% rename from src/integrationtest/python/issue_35/manifests.yaml rename to src/integrationtest/python/issue_35/test/manifests.yaml index b63eca7..9fcb0aa 100644 --- a/src/integrationtest/python/issue_35/manifests.yaml +++ b/src/integrationtest/python/issue_35/test/manifests.yaml @@ -16,3 +16,13 @@ spec: - 'topology.kubernetes.io/zone' - 'topology.kubernetes.io/region' - '*' +--- +apiVersion: "stable.example.com/v1" +kind: CronTab +metadata: + name: my-new-cron-object + namespace: default +spec: + cronSpec: "* * * * */5" + image: my-awesome-cron-image + thispropertydoesntexist: so sad diff --git a/src/integrationtest/python/issue_35_tests.py b/src/integrationtest/python/issue_35_tests.py index 9709a6d..eac05c8 100644 --- a/src/integrationtest/python/issue_35_tests.py +++ b/src/integrationtest/python/issue_35_tests.py @@ -22,12 +22,15 @@ from pathlib import Path # noqa: E402 import os # noqa: E402 +import sys # noqa: E402 import tempfile # noqa: E402 class Issue35Test(IntegrationTestSupport): def test_issue_35(self): - test_dir = Path(__file__).parent / "issue_35" + issue_dir = Path(__file__).parent / "issue_35" + crd_dir = issue_dir / "crd" + test_dir = issue_dir / "test" for k8s_version in ["1.20.15", "1.23.17", "1.25.16", "1.28.4"]: k8s_minor = int(k8s_version[2:4]) @@ -43,29 +46,47 @@ def test_issue_35(self): os.environ["FIELD_VALIDATION"] = validation os.environ["WARN_FATAL"] = "1" if warn_fatal else "" - with tempfile.TemporaryDirectory() as temp_dir: - log_file = str(Path(temp_dir) / "log") - try: - self.run_module_test("kubernator", "-p", str(test_dir), - "--log-format", "json", - "--log-file", log_file, - "apply") - except AssertionError: - if ((not warn_fatal and validation == "Warn") or - validation == "Ignore" or - k8s_minor < 25): - raise - logs = self.load_json_logs(log_file) - validation_msg_found = False - for log in logs: - if "FAILED FIELD VALIDATION" in log["message"]: - validation_msg_found = True - break + if phase == 0: + self.run_module_test("kubernator", "-p", str(crd_dir), + "-v", "DEBUG", + "apply", "--yes") + self.run_module_test("kubernator", "-p", str(test_dir), + "-v", "DEBUG", + "dump") + logs = None + try: + with tempfile.TemporaryDirectory() as temp_dir: + log_file = str(Path(temp_dir) / "log") + try: + self.run_module_test("kubernator", "-p", str(test_dir), + "--log-format", "json", + "--log-file", log_file, + "-v", "DEBUG", + "apply") + logs = self.load_json_logs(log_file) + except AssertionError: + logs = self.load_json_logs(log_file) + if ((not warn_fatal and validation == "Warn") or + validation == "Ignore" or + k8s_minor < 25): + raise - if k8s_minor < 24 or validation == "Ignore": - self.assertFalse(validation_msg_found) - elif validation in ("Warn", "Strict"): - self.assertTrue(validation_msg_found) + validation_msg_found = False + for log in logs: + if "FAILED FIELD VALIDATION" in log["message"]: + validation_msg_found = True + break + + if k8s_minor < 24 or validation == "Ignore": + self.assertFalse(validation_msg_found) + elif validation in ("Warn", "Strict"): + self.assertTrue(validation_msg_found) + finally: + if logs: + for log in logs: + print(f"{log['ts']} {log['name']} {log['level']} {log['fn']}:{log['ln']} " + f"{log['message']}", + file=sys.stderr) if __name__ == "__main__": diff --git a/src/integrationtest/python/smoke_pre_cache_tests.py b/src/integrationtest/python/smoke_pre_cache_tests.py new file mode 100644 index 0000000..e2e6ef7 --- /dev/null +++ b/src/integrationtest/python/smoke_pre_cache_tests.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Express Systems USA, Inc +# Copyright 2023 Karellen, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from test_support import IntegrationTestSupport, unittest + + +class PreCacheSmokeTest(IntegrationTestSupport): + + def setUp(self): + self.run_module_test("kubernator", "--clear-k8s-cache") + + def test_precache(self): + for k8s_version in range(19, 29): + for disable_patches in (True, False, True): + with self.subTest(k8s_version=k8s_version, disable_patches=disable_patches): + args = ["kubernator", "--pre-cache-k8s-client", str(k8s_version)] + if disable_patches: + args.append("--pre-cache-k8s-client-no-patch") + self.run_module_test(*args) + + @classmethod + def tearDownClass(cls): + cls().run_module_test("kubernator", "--clear-k8s-cache") + + +if __name__ == "__main__": + unittest.main() diff --git a/src/main/python/kubernator/_k8s_client_patches.py b/src/main/python/kubernator/_k8s_client_patches.py new file mode 100644 index 0000000..055e893 --- /dev/null +++ b/src/main/python/kubernator/_k8s_client_patches.py @@ -0,0 +1,617 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Express Systems USA, Inc +# Copyright 2024 Karellen, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# flake8: noqa + +URLLIB_HEADERS_PATCH = ("@@ -2909,20 +2909,15 @@\n esp.\n-get\n headers\n-()\n %0A \n", + "kubernetes/client/exceptions.py", "http_resp.headers", None, None, "urllib_headers_patch") +CUSTOM_OBJECT_PATCH_23 = ("""@@ -2517,32 +2517,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -6004,32 +6004,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -8031,33 +8031,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -11267,32 +11267,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -14268,32 +14268,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -17722,32 +17722,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -19774,33 +19774,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -23568,32 +23568,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -36926,32 +36926,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -40085,32 +40085,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -42457,32 +42457,62 @@ + 'pretty',%0A ++ 'label_selector',%0A + 'gra +@@ -45089,32 +45089,247 @@ + ) # noqa: E501%0A ++ if 'label_selector' in local_var_params and local_var_params%5B'label_selector'%5D is not None: # noqa: E501%0A query_params.append(('labelSelector', local_var_params%5B'label_selector'%5D)) # noqa: E501%0A + if 'grac +@@ -48371,32 +48371,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -51650,32 +51650,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -54047,32 +54047,62 @@ + 'pretty',%0A ++ 'label_selector',%0A + 'gra +@@ -57245,32 +57245,247 @@ + ) # noqa: E501%0A ++ if 'label_selector' in local_var_params and local_var_params%5B'label_selector'%5D is not None: # noqa: E501%0A query_params.append(('labelSelector', local_var_params%5B'label_selector'%5D)) # noqa: E501%0A + if 'grac +@@ -157323,32 +157323,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -161012,32 +161012,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -163237,32 +163237,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -166808,32 +166808,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -167725,32 +167725,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -170267,32 +170267,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -173960,32 +173960,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -176185,32 +176185,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -179792,32 +179792,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -180768,32 +180768,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -183320,32 +183320,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -187018,32 +187018,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -189243,32 +189243,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -192856,32 +192856,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -193832,32 +193832,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -196491,32 +196491,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -200302,32 +200302,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -202552,32 +202552,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -206683,32 +206683,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -207600,32 +207600,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -210271,32 +210271,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -214084,32 +214084,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -216334,32 +216334,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -220507,32 +220507,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -221483,32 +221483,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -221530,32 +221530,64 @@ + merge-patch+json ++', 'application/apply-patch+yaml + '%5D) # noqa: E50 +@@ -224196,32 +224196,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -228014,32 +228014,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -230264,32 +230264,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -234444,32 +234444,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -235420,32 +235420,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -235467,32 +235467,64 @@ + merge-patch+json ++', 'application/apply-patch+yaml + '%5D) # noqa: E50 +@@ -237883,32 +237883,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -241233,32 +241233,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -243258,33 +243258,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -246821,32 +246821,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -249716,32 +249716,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -253057,32 +253057,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -255082,33 +255082,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -258681,32 +258681,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -261645,32 +261645,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -264991,32 +264991,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -267016,33 +267016,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -270621,32 +270621,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -273705,32 +273705,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -277177,32 +277177,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -279227,33 +279227,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -283352,32 +283352,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -286376,32 +286376,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -289837,32 +289837,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -291887,33 +291887,65 @@ + 'field_manager' ++,%0A 'field_validation' + %0A + %5D%0A +@@ -296054,32 +296054,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -299147,32 +299147,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -302613,32 +302613,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -304671,17 +304671,49 @@ + manager' ++,%0A 'field_validation' + %0A + +@@ -308837,32 +308837,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +""", "kubernetes/client/api/custom_objects_api.py", "field_validation", 23, 24, "field_validation_patch_23-24") + +CUSTOM_OBJECT_PATCH_25 = ("""@@ -2532,32 +2532,1022 @@ + %0A :param ++str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A :param + _preload_content +@@ -3587,32 +3587,32 @@ + nse object will%0A +- + +@@ -6004,32 +6004,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -8031,32 +8031,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -11267,32 +11267,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -14268,32 +14268,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -17722,32 +17722,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -19774,32 +19774,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -23568,32 +23568,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -36926,32 +36926,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -40085,32 +40085,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -42457,32 +42457,62 @@ + 'pretty',%0A ++ 'label_selector',%0A + 'gra +@@ -45089,32 +45089,247 @@ + ) # noqa: E501%0A ++ if 'label_selector' in local_var_params and local_var_params%5B'label_selector'%5D is not None: # noqa: E501%0A query_params.append(('labelSelector', local_var_params%5B'label_selector'%5D)) # noqa: E501%0A + if 'grac +@@ -48371,32 +48371,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -51650,32 +51650,160 @@ + pretty printed.%0A ++ :param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.%0A + :param i +@@ -54047,32 +54047,62 @@ + 'pretty',%0A ++ 'label_selector',%0A + 'gra +@@ -57245,32 +57245,247 @@ + ) # noqa: E501%0A ++ if 'label_selector' in local_var_params and local_var_params%5B'label_selector'%5D is not None: # noqa: E501%0A query_params.append(('labelSelector', local_var_params%5B'label_selector'%5D)) # noqa: E501%0A + if 'grac +@@ -163053,32 +163053,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -166742,32 +166742,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -168967,32 +168967,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -172538,32 +172538,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -173455,32 +173455,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -175997,32 +175997,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -179690,32 +179690,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -181915,32 +181915,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -185522,32 +185522,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -186498,32 +186498,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -189050,32 +189050,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -192748,32 +192748,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -194973,32 +194973,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -198586,32 +198586,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -199562,32 +199562,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -202221,32 +202221,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -206032,32 +206032,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -208282,32 +208282,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -212413,32 +212413,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -213330,32 +213330,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -216001,32 +216001,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -219814,32 +219814,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -222064,32 +222064,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -226237,32 +226237,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -227213,32 +227213,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -227260,32 +227260,64 @@ + merge-patch+json ++', 'application/apply-patch+yaml + '%5D) # noqa: E50 +@@ -229926,32 +229926,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -233744,32 +233744,1022 @@ + gicMergePatch).%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param b +@@ -235994,32 +235994,64 @@ + field_manager',%0A ++ 'field_validation',%0A + 'for +@@ -240174,32 +240174,255 @@ + ) # noqa: E501%0A ++ if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501%0A + if 'forc +@@ -241150,32 +241150,63 @@ + %5B'application/ ++json-patch+json', 'application/ + merge-patch+json +@@ -241197,32 +241197,64 @@ + merge-patch+json ++', 'application/apply-patch+yaml + '%5D) # noqa: E50 +@@ -243613,32 +243613,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -246963,32 +246963,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -248988,32 +248988,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -252551,32 +252551,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -255446,32 +255446,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -258787,32 +258787,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -260812,32 +260812,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -264411,32 +264411,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -267375,32 +267375,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -270721,32 +270721,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -272746,32 +272746,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -276351,32 +276351,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -279435,32 +279435,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -282907,32 +282907,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -284957,32 +284957,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -289082,32 +289082,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -292106,32 +292106,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -295567,32 +295567,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -297617,32 +297617,64 @@ + 'field_manager' ++,%0A 'field_validation' + %0A %5D%0A +@@ -301784,32 +301784,255 @@ + )) # noqa: E501 ++%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation'%5D)) # noqa: E501 + %0A%0A header +@@ -304877,32 +304877,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -308343,32 +308343,1022 @@ + icode/#IsPrint.%0A ++ :param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)%0A + :param _ +@@ -310401,16 +310401,48 @@ + manager' ++,%0A 'field_validation' + %0A +@@ -314469,32 +314469,32 @@ + : # noqa: E501%0A +- + quer L +@@ -314549,32 +314549,255 @@ + s%5B'field_manager ++'%5D)) # noqa: E501%0A if 'field_validation' in local_var_params and local_var_params%5B'field_validation'%5D is not None: # noqa: E501%0A query_params.append(('fieldValidation', local_var_params%5B'field_validation + '%5D)) # noqa: E5 +""", "kubernetes/client/api/custom_objects_api.py", "field_validation", 25, None, "field_validation_patch_25+") diff --git a/src/main/python/kubernator/api.py b/src/main/python/kubernator/api.py index f13c6f3..efc7bf9 100644 --- a/src/main/python/kubernator/api.py +++ b/src/main/python/kubernator/api.py @@ -40,6 +40,7 @@ import requests import yaml from appdirs import user_config_dir +from diff_match_patch import diff_match_patch from jinja2 import (Environment, ChainableUndefined, make_logging_undefined, @@ -47,6 +48,9 @@ pass_context) from jsonpath_ng.ext import parse as jp_parse from jsonschema import validators +from kubernator._k8s_client_patches import (URLLIB_HEADERS_PATCH, + CUSTOM_OBJECT_PATCH_23, + CUSTOM_OBJECT_PATCH_25) _CACHE_HEADER_TRANSLATION = {"etag": "if-none-match", "last-modified": "if-modified-since"} @@ -228,20 +232,6 @@ def set_defaults(validator, properties, instance, schema): return validators.extend(validator_class, {"properties": set_defaults}) -def install_python_k8s_client(run, package_major, logger_stdout, logger_stderr): - cache_dir = get_cache_dir("python") - package_major_dir = cache_dir / str(package_major) - - if not package_major_dir.exists(): - package_major_dir.mkdir(parents=True, exist_ok=True) - - run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-cache-dir", "--no-input", "--pre", - "--root-user-action=ignore", "--break-system-packages", "--disable-pip-version-check", - "--target", str(package_major_dir), f"kubernetes~={package_major}.0"], logger_stdout, logger_stderr).wait() - - return package_major_dir - - class _PropertyList(MutableSequence): def __init__(self, seq, read_parent, name): @@ -795,3 +785,63 @@ def handle_verify(self): def handle_shutdown(self): pass + + +def install_python_k8s_client(run, package_major, logger, logger_stdout, logger_stderr, disable_patching): + cache_dir = get_cache_dir("python") + package_major_dir = cache_dir / str(package_major) + package_major_dir_str = str(package_major_dir) + patch_indicator = package_major_dir / ".patched" + + if disable_patching and package_major_dir.exists() and patch_indicator.exists(): + logger.info("Patching is disabled, existing Kubernetes Client %s (%s) was patched - " + "deleting current client", + str(package_major), package_major_dir) + rmtree(package_major_dir) + + if not package_major_dir.exists(): + package_major_dir.mkdir(parents=True, exist_ok=True) + run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-input", "--pre", + "--root-user-action=ignore", "--break-system-packages", "--disable-pip-version-check", + "--target", package_major_dir_str, f"kubernetes~={package_major}.0"], logger_stdout, logger_stderr).wait() + + if not patch_indicator.exists() and not disable_patching: + for patch_text, target_file, skip_if_found, min_version, max_version, name in ( + URLLIB_HEADERS_PATCH, CUSTOM_OBJECT_PATCH_23, CUSTOM_OBJECT_PATCH_25): + patch_target = package_major_dir / target_file + logger.info("Applying patch %s to %s...", name, patch_target) + if min_version and int(package_major) < min_version: + logger.info("Skipping patch %s on %s due to package major version %s below minimum %d!", + name, patch_target, package_major, min_version) + continue + if max_version and int(package_major) > max_version: + logger.info("Skipping patch %s on %s due to package major version %s above maximum %d!", + name, patch_target, package_major, max_version) + continue + + with open(patch_target, "rt") as f: + target_file_original = f.read() + if skip_if_found in target_file_original: + logger.info("Skipping patch %s on %s, as it already appears to be patched!", name, + patch_target) + continue + + dmp = diff_match_patch() + patches = dmp.patch_fromText(patch_text) + target_file_patched, results = dmp.patch_apply(patches, target_file_original) + failed_patch = False + for idx, result in enumerate(results): + if not result: + failed_patch = True + msg = ("Failed to apply a patch to Kubernetes Client API %s, hunk #%d, patch: \n%s" % ( + patch_target, idx, patches[idx])) + logger.fatal(msg) + if failed_patch: + raise RuntimeError(f"Failed to apply some Kubernetes Client API {patch_target} patches") + + with open(patch_target, "wt") as f: + f.write(target_file_patched) + + patch_indicator.touch(exist_ok=False) + + return package_major_dir diff --git a/src/main/python/kubernator/app.py b/src/main/python/kubernator/app.py index 941fc9e..89f5e44 100644 --- a/src/main/python/kubernator/app.py +++ b/src/main/python/kubernator/app.py @@ -32,7 +32,7 @@ import kubernator from kubernator.api import (KubernatorPlugin, Globs, scan_dir, PropertyDict, config_as_dict, config_parent, download_remote_file, load_remote_file, Repository, StripNL, jp, get_app_cache_dir, - install_python_k8s_client) + get_cache_dir, install_python_k8s_client) from kubernator.proc import run, run_capturing_out TRACE = 5 @@ -65,8 +65,12 @@ def define_arg_parse(): help="print version and exit") g.add_argument("--clear-cache", action="store_true", help="clear cache and exit") + g.add_argument("--clear-k8s-cache", action="store_true", + help="clear Kubernetes Client cache and exit") g.add_argument("--pre-cache-k8s-client", action="extend", nargs="+", type=int, - help="download specified K8S client library minor(!) version(s) and exit") + help="download specified K8S client library major(!) version(s) and exit") + parser.add_argument("--pre-cache-k8s-client-no-patch", action="store_true", default=None, + help="do not patch the k8s client being pre-cached") parser.add_argument("--log-format", choices=["human", "json"], default="human", help="whether to log for human or machine consumption") parser.add_argument("--log-file", type=argparse.FileType("w"), default=None, @@ -453,23 +457,37 @@ def __repr__(self): def clear_cache(): cache_dir = get_app_cache_dir() - logger.info("Clearing application cache at %s", cache_dir) + _clear_cache("Clearing application cache at %s", cache_dir) + + +def clear_k8s_cache(): + cache_dir = get_cache_dir("python") + _clear_cache("Clearing Kubernetes Client cache at %s", cache_dir) + + +def _clear_cache(msg, cache_dir): + logger.info(msg, cache_dir) if cache_dir.exists(): rmtree(cache_dir) -def pre_cache_k8s_clients(*versions): +def pre_cache_k8s_clients(*versions, disable_patching=False): proc_logger = logger.getChild("proc") stdout_logger = StripNL(proc_logger.info) stderr_logger = StripNL(proc_logger.warning) for v in versions: - logger.info("Caching K8S client library ~=v%s.0...", v) - install_python_k8s_client(run, v, stdout_logger, stderr_logger) + logger.info("Caching K8S client library ~=v%s.0%s...", v, + " (no patches)" if disable_patching else "") + install_python_k8s_client(run, v, logger, stdout_logger, stderr_logger, disable_patching) def main(): - args = define_arg_parse().parse_args() + argparser = define_arg_parse() + args = argparser.parse_args() + if not args.pre_cache_k8s_client and args.pre_cache_k8s_client_no_patch is not None: + argparser.error("--pre-cache-k8s-client-no-patch can only be used with --pre-cache-k8s-client") + init_logging(args.verbose, args.log_format, args.log_file) try: @@ -477,8 +495,13 @@ def main(): clear_cache() return + if args.clear_k8s_cache: + clear_k8s_cache() + return + if args.pre_cache_k8s_client: - pre_cache_k8s_clients(*args.pre_cache_k8s_client) + pre_cache_k8s_clients(*args.pre_cache_k8s_client, + disable_patching=args.pre_cache_k8s_client_no_patch) return with App(args) as app: diff --git a/src/main/python/kubernator/plugins/k8s.py b/src/main/python/kubernator/plugins/k8s.py index 97b05c1..bfe0446 100644 --- a/src/main/python/kubernator/plugins/k8s.py +++ b/src/main/python/kubernator/plugins/k8s.py @@ -84,7 +84,10 @@ def __init__(self): def set_context(self, context): self.context = context - def register(self, field_validation="Strict", field_validation_warn_fatal=True): + def register(self, + field_validation="Warn", + field_validation_warn_fatal=True, + disable_client_patches=False): self.context.app.register_plugin("kubeconfig") if field_validation not in VALID_FIELD_VALIDATION: @@ -113,6 +116,7 @@ def register(self, field_validation="Strict", field_validation_warn_fatal=True): add_validator=self.api_remove_validator, get_api_versions=self.get_api_versions, create_resource=self.create_resource, + disable_client_patches=disable_client_patches, field_validation=field_validation, field_validation_warn_fatal=field_validation_warn_fatal, field_validation_warnings=0, @@ -142,27 +146,24 @@ def setup_client(self): self._setup_client() server_minor = k8s.server_version[1] - pkg_major = self.embedded_pkg_version[0] - if server_minor != pkg_major: - logger.info("Bundled Kubernetes client version %s doesn't match server version %s", - ".".join(self.embedded_pkg_version), ".".join(k8s.server_version)) - pkg_dir = install_python_k8s_client(self.context.app.run, server_minor, stdout_logger, stderr_logger) - - modules_to_delete = [] - for k, v in sys.modules.items(): - if k == "kubernetes" or k.startswith("kubernetes."): - modules_to_delete.append(k) - for k in modules_to_delete: - del sys.modules[k] - - logger.info("Adding sys.path reference to %s", pkg_dir) - sys.path.insert(0, str(pkg_dir)) - self.embedded_pkg_version = self._get_kubernetes_client_version() - logger.info("Switching to Kubernetes client version %s", ".".join(self.embedded_pkg_version)) - self._setup_client() - else: - logger.info("Bundled Kubernetes client version %s matches server version %s", - ".".join(self.embedded_pkg_version), ".".join(k8s.server_version)) + + logger.info("Using Kubernetes client version =~%s.0 for server version %s", + server_minor, ".".join(k8s.server_version)) + pkg_dir = install_python_k8s_client(self.context.app.run, server_minor, logger, + stdout_logger, stderr_logger, k8s.disable_client_patches) + + modules_to_delete = [] + for k, v in sys.modules.items(): + if k == "kubernetes" or k.startswith("kubernetes."): + modules_to_delete.append(k) + for k in modules_to_delete: + del sys.modules[k] + + logger.info("Adding sys.path reference to %s", pkg_dir) + sys.path.insert(0, str(pkg_dir)) + self.embedded_pkg_version = self._get_kubernetes_client_version() + logger.info("Switching to Kubernetes client version %s", ".".join(self.embedded_pkg_version)) + self._setup_client() logger.debug("Reading Kubernetes OpenAPI spec for %s", k8s.server_git_version) @@ -192,6 +193,7 @@ def _setup_client(self): logger.info("Found Kubernetes %s on %s", k8s.server_git_version, k8s.client.configuration.host) K8SResource._k8s_client_version = tuple(map(int, pkg_version("kubernetes").split("."))) K8SResource._k8s_field_validation = k8s.field_validation + K8SResource._k8s_field_validation_patched = not k8s.disable_client_patches K8SResource._logger = self.logger K8SResource._api_warnings = self._api_warnings diff --git a/src/main/python/kubernator/plugins/k8s_api.py b/src/main/python/kubernator/plugins/k8s_api.py index 4a7d0bb..261e507 100644 --- a/src/main/python/kubernator/plugins/k8s_api.py +++ b/src/main/python/kubernator/plugins/k8s_api.py @@ -340,6 +340,7 @@ def __str__(self): class K8SResource: _k8s_client_version = None _k8s_field_validation = None + _k8s_field_validation_patched = None _logger = None _api_warnings = None @@ -411,7 +412,7 @@ def create(self, dry_run=True): } # `and not self.rdef.custom` to be removed after solving https://github.com/kubernetes-client/gen/issues/259 - if self._k8s_client_version[0] > 22 and not self.rdef.custom: + if self._k8s_client_version[0] > 22 and (self._k8s_field_validation_patched or not self.rdef.custom): kwargs["field_validation"] = self._k8s_field_validation if rdef.namespaced: kwargs["namespace"] = self.namespace @@ -432,7 +433,7 @@ def patch(self, json_patch, *, patch_type: K8SResourcePatchType, force=False, dr } # `and not self.rdef.custom` to be removed after solving https://github.com/kubernetes-client/gen/issues/259 - if self._k8s_client_version[0] > 22 and not self.rdef.custom: + if self._k8s_client_version[0] > 22 and (self._k8s_field_validation_patched or not self.rdef.custom): kwargs["field_validation"] = self._k8s_field_validation if patch_type == K8SResourcePatchType.SERVER_SIDE_PATCH: kwargs["force"] = force diff --git a/src/main/python/kubernator/plugins/minikube.py b/src/main/python/kubernator/plugins/minikube.py index 2209325..e3d2180 100644 --- a/src/main/python/kubernator/plugins/minikube.py +++ b/src/main/python/kubernator/plugins/minikube.py @@ -124,7 +124,7 @@ def register(self, minikube_version=None, profile="default", k8s_version=None, profile_dir = get_cache_dir("minikube") self.minikube_home_dir = profile_dir self.minikube_home_dir.mkdir(parents=True, exist_ok=True) - self.kubeconfig_dir = profile_dir / ".kube" + self.kubeconfig_dir = profile_dir / ".kube" / profile self.kubeconfig_dir.mkdir(parents=True, exist_ok=True) if not driver: