Skip to content

Commit 25b8e02

Browse files
authored
Update worflow_job_template to always allow missig state (#469)
workflow_job_templates required `state` to be defined when using simplified_worklow_nodes. This change now allows `state` to be undefined when using simplified_workflow_nodes.
1 parent 7581982 commit 25b8e02

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.github/tests/configs/differential_items.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@ differential_items:
138138
- name: Simple workflow schema2
139139
organization: Default
140140
state: absent
141+
- name: Simple workflow schema no state defined
142+
organization: Default
143+
state: absent
141144
...

.github/tests/configs/workflows.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,47 @@ controller_workflows:
7373
notification_templates_success: []
7474
notification_templates_error: []
7575
notification_templates_approvals: []
76+
- name: Simple workflow schema no state defined
77+
description: a basic workflow
78+
extra_vars: {}
79+
survey_enabled: false
80+
allow_simultaneous: false
81+
ask_variables_on_launch: false
82+
inventory:
83+
limit:
84+
job_tags:
85+
- stuff
86+
- stuff2
87+
skip_tags:
88+
- stuff3
89+
ask_labels_on_launch: true
90+
ask_skip_tags_on_launch: true
91+
labels:
92+
- Prod
93+
scm_branch:
94+
ask_inventory_on_launch: false
95+
ask_scm_branch_on_launch: false
96+
ask_limit_on_launch: false
97+
organization: Default
98+
schedules: []
99+
simplified_workflow_nodes:
100+
- all_parents_must_converge: false
101+
identifier: node101
102+
unified_job_template: RHVM-01
103+
success_nodes:
104+
- node201
105+
- all_parents_must_converge: false
106+
identifier: node201
107+
unified_job_template: test-template-1
108+
instance_groups:
109+
- default
110+
labels:
111+
- differential
112+
- differential2
113+
timeout: 165
114+
notification_templates_started: []
115+
notification_templates_success: []
116+
notification_templates_error: []
117+
notification_templates_approvals: []
118+
survey_spec: {}
76119
...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bugfixes:
2+
- Enable the ability to define simple_workflow_nodes on workflow_job_templates
3+
without the need to set the `state` on a workflow_job_template
4+
(https://github.com/redhat-cop/controller_configuration/issues/297).

roles/workflow_job_templates/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@
7575
loop_var: __workflow_loop_item
7676
when:
7777
- __workflow_loop_item.simplified_workflow_nodes is defined
78-
- __workflow_loop_item.state == "present"
78+
- (__workflow_loop_item.state | default('present')) == "present"
7979
...

0 commit comments

Comments
 (0)