mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-11-24 09:53:33 +00:00
Handle empty template output gracefully (#1044)
* Handle empty template output gracefully * Add changelog fragment for empty template output fix * refactor: reduce cognitive complexity of ActionModule.run Extract compound boolean condition to a variable to reduce the cognitive complexity from 16 to the allowed maximum of 15. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract duplicated error handling into _fail_with_error Replace two identical error-handling blocks in ActionModule.run() with a shared _fail_with_error static method to address SonarQube code duplication finding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: reduce code duplication in action plugin and tests Revert _fail_with_error extraction that increased duplication on new code. Consolidate duplicate integration test tasks for conditional template into a single looped task. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: aubin bikouo <abikouo@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
aubin bikouo
Claude Opus 4.6
parent
08a761fc17
commit
ec8942dd90
@@ -0,0 +1,12 @@
|
||||
{% for item in items %}
|
||||
{% if item.enabled %}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "{{ item.name }}"
|
||||
namespace: "{{ k8s_pod_namespace }}"
|
||||
data:
|
||||
key: value
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user