mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-25 08:54:51 +00:00
* Add kubeconfig module for managing Kubernetes config files
* Remove unnecessary requirement & Change version
* Move functions to module_utils
* Add unit tests
* Add kubeconfig module for managing Kubernetes config files
* Remove unnecessary requirement & Change version
* Move functions to module_utils
* Add unit tests
* Avoid linter errors
* Improve documentation clarity
* Redact sensitive kubeconfig information
* Imprvoe verbosity
* Move import statement for to_native to avoid linters check failure
* Fix linting error
* Add remove behavior
* Add tests for remove behavior
* Imporve documentation
* Add changelog
---------
(cherry picked from commit 53c6c0ee80)
Co-authored-by: Youssef Ali <154611350+YoussefKhalidAli@users.noreply.github.com>
Co-authored-by: Bianca Henderson <bianca@redhat.com>
This commit is contained in:
@@ -53,6 +53,8 @@ def merge_by_name(existing, new):
|
||||
if name in merged:
|
||||
if behavior == "keep":
|
||||
continue
|
||||
elif behavior == "remove":
|
||||
del merged[name]
|
||||
elif behavior == "replace":
|
||||
merged[name] = item_copy
|
||||
else:
|
||||
@@ -73,6 +75,8 @@ def merge_by_name(existing, new):
|
||||
result[key] = item_copy[key]
|
||||
merged[name] = result
|
||||
else:
|
||||
if behavior == "remove":
|
||||
continue
|
||||
merged[name] = item_copy
|
||||
|
||||
return list(merged.values())
|
||||
|
||||
Reference in New Issue
Block a user