mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
Add merge_type parameter to k8s module (#42219)
Allows patching of custom Kubernetes resources that don't support strategic merge patching Check that openshift module supports content_type param (requires version newer than 0.6.0)
This commit is contained in:
parent
40fbee6369
commit
0b77262288
3 changed files with 36 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
|||
#
|
||||
# Copyright 2018 Red Hat | Ansible
|
||||
# Copyright 2018 Red Hat | Ansible
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
|
@ -27,6 +26,7 @@ from ansible.module_utils.six import iteritems, string_types
|
|||
|
||||
try:
|
||||
import kubernetes
|
||||
import openshift
|
||||
from openshift.dynamic import DynamicClient
|
||||
from openshift.dynamic.exceptions import ResourceNotFoundError, ResourceNotUniqueError
|
||||
HAS_K8S_MODULE_HELPER = True
|
||||
|
@ -258,6 +258,7 @@ class KubernetesAnsibleModule(AnsibleModule, K8sAnsibleMixin):
|
|||
|
||||
if not HAS_K8S_MODULE_HELPER:
|
||||
self.fail_json(msg="This module requires the OpenShift Python client. Try `pip install openshift`")
|
||||
self.openshift_version = openshift.__version__
|
||||
|
||||
if not HAS_YAML:
|
||||
self.fail_json(msg="This module requires PyYAML. Try `pip install PyYAML`")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue