Skip to content

Commit 18695b9

Browse files
authored
Merge pull request #327 from nmars/add-subscription-check
Add check for openshift subscription
2 parents a79df1d + 4556250 commit 18695b9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

roles/parse_operator_bundle/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,13 @@
104104
set_fact:
105105
csv_vars: "{{ csv_data.stdout }}"
106106

107-
- name: "Determine and set fact for operator specific information - name, pod name, container name and capabilities"
107+
- name: "Determine and set fact for operator specific information - name, pod name, container name, capabilities, and subscription"
108108
set_fact:
109109
current_csv: "{{ (csv_vars | from_yaml).metadata.name }}"
110110
operator_pod_name: "{{ (csv_vars | from_yaml).spec.install.spec.deployments[0].name }}"
111111
operator_container_name: "{{ (csv_vars | from_yaml).spec.install.spec.deployments[0].spec.template.spec.containers[0].name }}"
112112
operator_capabilities: "{{ (csv_vars | from_yaml).metadata.annotations.capabilities }}"
113+
operator_valid_subscription: "{{ (csv_vars | from_yaml).metadata.annotations['operators.openshift.io/valid-subscription'] | default([]) }}"
113114

114115
- name: "Determine operator_allnamespaces_support"
115116
set_fact:

roles/parse_operator_bundle/templates/parsed_operator_data.yml.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ operator_allnamespaces_support: {{ operator_allnamespaces_support }}
1313
operator_ownnamespace_support: {{ operator_ownnamespace_support }}
1414
operator_singlenamespace_support: {{ operator_singlenamespace_support }}
1515
operator_multinamespace_support: {{ operator_multinamespace_support }}
16+
{% if operator_valid_subscription|length < 1 %}
17+
operator_valid_subscription: []
18+
{% else %}
19+
operator_valid_subscription:
20+
{% for valid_subscription in operator_valid_subscription %}
21+
- {{ valid_subscription }}
22+
{% endfor %}
23+
{% endif %}
1624
{% if crd_paths|length < 1 %}
1725
crd_paths: []
1826
{% else %}

0 commit comments

Comments
 (0)