mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-28 02:14:41 +00:00
k8s - remove support for merge_type=json (#722)
k8s - remove support for merge_type=json SUMMARY Support for merge_type=json has been removed in version 4.0.0. Please use kubernetes.core.k8s_json_patch instead. ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME k8s.py ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: Mike Graves <mgraves@redhat.com>
This commit is contained in:
2
changelogs/fragments/k8s-merge_type-removed.yml
Normal file
2
changelogs/fragments/k8s-merge_type-removed.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
removed_features:
|
||||||
|
- k8s - Support for ``merge_type=json`` has been removed in version 4.0.0. Please use ``kubernetes.core.k8s_json_patch`` instead (https://github.com/ansible-collections/kubernetes.core/pull/722).
|
||||||
@@ -145,12 +145,6 @@ class K8sService:
|
|||||||
namespace: str,
|
namespace: str,
|
||||||
merge_type: str = None,
|
merge_type: str = None,
|
||||||
) -> Tuple[Dict, List[str]]:
|
) -> Tuple[Dict, List[str]]:
|
||||||
if merge_type == "json":
|
|
||||||
self.module.deprecate(
|
|
||||||
msg="json as a merge_type value is deprecated. Please use the k8s_json_patch module instead.",
|
|
||||||
version="4.0.0",
|
|
||||||
collection_name="kubernetes.core",
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
params = dict(name=name, namespace=namespace, serialize=False)
|
params = dict(name=name, namespace=namespace, serialize=False)
|
||||||
if merge_type:
|
if merge_type:
|
||||||
|
|||||||
@@ -57,15 +57,14 @@ options:
|
|||||||
- Whether to override the default patch merge approach with a specific type. By default, the strategic
|
- Whether to override the default patch merge approach with a specific type. By default, the strategic
|
||||||
merge will typically be used.
|
merge will typically be used.
|
||||||
- For example, Custom Resource Definitions typically aren't updatable by the usual strategic merge. You may
|
- For example, Custom Resource Definitions typically aren't updatable by the usual strategic merge. You may
|
||||||
want to use C(merge) if you see "strategic merge patch format is not supported"
|
want to use C(merge) if you see "strategic merge patch format is not supported".
|
||||||
- See U(https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment)
|
- See U(https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment)
|
||||||
- If more than one C(merge_type) is given, the merge_types will be tried in order. This defaults to
|
- If more than one C(merge_type) is given, the merge_types will be tried in order. This defaults to
|
||||||
C(['strategic-merge', 'merge']), which is ideal for using the same parameters on resource kinds that
|
C(['strategic-merge', 'merge']), which is ideal for using the same parameters on resource kinds that
|
||||||
combine Custom Resources and built-in resources.
|
combine Custom Resources and built-in resources.
|
||||||
- mutually exclusive with C(apply)
|
- Mutually exclusive with C(apply).
|
||||||
- I(merge_type=json) is deprecated and will be removed in version 4.0.0. Please use M(kubernetes.core.k8s_json_patch) instead.
|
- I(merge_type=json) has been removed in version 4.0.0. Please use M(kubernetes.core.k8s_json_patch) instead.
|
||||||
choices:
|
choices:
|
||||||
- json
|
|
||||||
- merge
|
- merge
|
||||||
- strategic-merge
|
- strategic-merge
|
||||||
type: list
|
type: list
|
||||||
@@ -101,7 +100,7 @@ options:
|
|||||||
- C(apply) compares the desired resource definition with the previously supplied resource definition,
|
- C(apply) compares the desired resource definition with the previously supplied resource definition,
|
||||||
ignoring properties that are automatically generated
|
ignoring properties that are automatically generated
|
||||||
- C(apply) works better with Services than 'force=yes'
|
- C(apply) works better with Services than 'force=yes'
|
||||||
- mutually exclusive with C(merge_type)
|
- Mutually exclusive with C(merge_type).
|
||||||
default: False
|
default: False
|
||||||
type: bool
|
type: bool
|
||||||
template:
|
template:
|
||||||
@@ -460,7 +459,7 @@ def argspec():
|
|||||||
argument_spec.update(copy.deepcopy(AUTH_ARG_SPEC))
|
argument_spec.update(copy.deepcopy(AUTH_ARG_SPEC))
|
||||||
argument_spec.update(copy.deepcopy(WAIT_ARG_SPEC))
|
argument_spec.update(copy.deepcopy(WAIT_ARG_SPEC))
|
||||||
argument_spec["merge_type"] = dict(
|
argument_spec["merge_type"] = dict(
|
||||||
type="list", elements="str", choices=["json", "merge", "strategic-merge"]
|
type="list", elements="str", choices=["merge", "strategic-merge"]
|
||||||
)
|
)
|
||||||
argument_spec["validate"] = dict(type="dict", default=None, options=validate_spec())
|
argument_spec["validate"] = dict(type="dict", default=None, options=validate_spec())
|
||||||
argument_spec["append_hash"] = dict(type="bool", default=False)
|
argument_spec["append_hash"] = dict(type="bool", default=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user