Skip to content

Commit ce1a3ff

Browse files
authored
Merge pull request #184 from LikhithaEda/local
CVP-1871 subtasks: Remove numbered rules from skip_list
2 parents 9771acc + f588eba commit ce1a3ff

File tree

24 files changed

+87
-82
lines changed

24 files changed

+87
-82
lines changed

.ansible-lint

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,3 @@ skip_list:
1616
- command-instead-of-shell # Use shell only when shell functionality is required
1717
# - yaml # Violations reported by yamllint
1818
- line-length
19-
- '102' # No Jinja2
20-
- '206' # Variables should have spaces before and after: {{ var_name}}
21-
- '301' # All tasks should be named
22-
- '302' # Include should has tags
23-
- '303' # Use ":" YAML syntax when arguments are over 4
24-
- '305' # Variable should has space "{{ foo }}"
25-
- '306' # Shells that use pipes should set the pipefail option
26-
- '403' # Package installs should not use latest
27-
- '502' # Use chown module
28-
- '601' # trailing whitespace
29-
- '602' # line too long

roles/build_catalog_upstream/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22

3-
- fail:
3+
- name: "Fail when bundle format is not supported"
4+
fail:
45
msg: "Bundle format is not supported in manifest test yet !!!"
56
when: operator_format == "bundle"
67

roles/build_image_bundle/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
mode: 0644
3030
remote_src: true
3131

32-
- set_fact:
32+
- name: "Store operator directory name"
33+
set_fact:
3334
operator_name: "{{ operator_dir | basename }}"
34-
35-
- set_fact:
3635
bundle_image: "{{ bundle_registry }}/{{ bundle_image_namespace }}/{{ operator_name }}:v{{ operator_version }}"
3736
clusterserviceversion_bundle_file_path: >
3837
"{{ operator_bundle_src_dir }}/{{ operator_name }}/{{
3938
operator_version }}/manifests/{{ operator_name }}.v{{
4039
operator_version }}.clusterserviceversion.yaml"
4140
annotation_file_path: "{{ operator_bundle_src_dir }}/{{ operator_name }}/{{ operator_version }}/metadata/annotations.yaml"
4241

43-
- set_fact:
42+
- name: "Set csv file path"
43+
set_fact:
4444
clusterserviceversion_bundle_file_path: "{{ operator_bundle_src_dir }}/{{ operator_name }}/{{ operator_version }}/{{ csv_file_path | basename }}"
4545
when: operator_format == "manifest"
4646

roles/collect_modified_images/tasks/parse_image_names.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
- name: "parse and return image name when timestamp is after start_time"
2222
set_fact:
2323
pulled_images: "{{ pulled_images + [image] }}"
24-
when: "{{ timestamp > deployment_start_time }}"
24+
when: timestamp > deployment_start_time

roles/convert_bundle_image_to_dir/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- name: Set input image
55
set_fact:
66
operator_input_image: "{{ operator_input_image | regex_replace('[A-z]*://', '') }}"
7-
operator_input_local_image: "{{ operator_local_registry }}/{{ operator_input_image | regex_replace('[A-z]*://', '') | basename}}"
7+
operator_input_local_image: "{{ operator_local_registry }}/{{ operator_input_image | regex_replace('[A-z]*://', '') | basename }}"
88

99
- name: Remove previous input image from local registry
1010
shell: "{{ opm_container_tool }} rmi -f {{ operator_input_local_image }}"

roles/deploy_olm_operator/tasks/main.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
when:
2121
- quay_release_result is defined
2222
- quay_release_result.stdout is defined
23-
- quay_release_result.stdout != ""
23+
- quay_release_result.stdout|length > 0
2424
- quay_release_result.stdout != "null"
2525

2626
- name: "Set quay release to the incremented one if exists"
@@ -29,7 +29,7 @@
2929
when:
3030
- quay_increment_release_result is defined
3131
- quay_increment_release_result.stdout is defined
32-
- quay_increment_release_result.stdout != ""
32+
- quay_increment_release_result.stdout|length > 0
3333

3434
- name: "Append the -test suffix to the packageName"
3535
shell: "{{ yq_bin_path }} w -i {{ package_path }} 'packageName' '{{ package_name }}-test'"
@@ -112,7 +112,7 @@
112112
shell: "{{ oc_bin_path }} create -f {{ operator_work_dir }}/../scorecard.secret.yaml"
113113
environment:
114114
KUBECONFIG: "{{ kubeconfig_path }}"
115-
when: scorecard_secret_result.stat.exists == True
115+
when: scorecard_secret_result.stat.exists
116116

117117
- name: "Create the subscription"
118118
shell: "{{ oc_bin_path }} create -f {{ olm_operator_files_path }}/subscription.yml"
@@ -141,7 +141,7 @@
141141
content: "{{ csv_describe_result.stdout }}"
142142
dest: "{{ work_dir }}/olm-operator-csv-debug.txt"
143143
mode: 0644
144-
when: csv_describe_result.stdout != ""
144+
when: csv_describe_result.stdout|length > 0
145145

146146
- name: "Get the pod status of the deployed operator"
147147
shell: >
@@ -151,16 +151,16 @@
151151
ignore_errors: true
152152
environment:
153153
KUBECONFIG: "{{ kubeconfig_path }}"
154-
when: csv_describe_result.stdout != ""
154+
when: csv_describe_result.stdout|length > 0
155155

156156
- name: "Output the operator pod log to a debug file"
157157
copy:
158158
content: "{{ operator_pod_result.stdout }}"
159159
dest: "{{ work_dir }}/olm-operator-pod-debug.txt"
160160
mode: 0644
161161
when:
162-
- csv_describe_result.stdout != ""
163-
- operator_pod_result.stdout != ""
162+
- csv_describe_result.stdout|length > 0
163+
- operator_pod_result.stdout|length > 0
164164

165165
- name: "Get the pod container logs of the deployed operator"
166166
shell: >
@@ -170,16 +170,16 @@
170170
ignore_errors: true
171171
environment:
172172
KUBECONFIG: "{{ kubeconfig_path }}"
173-
when: csv_describe_result.stdout != ""
173+
when: csv_describe_result.stdout|length > 0
174174

175175
- name: "Output the operator container log to a debug file"
176176
copy:
177177
content: "{{ operator_container_result.stdout }}"
178178
dest: "{{ work_dir }}/olm-operator-container-debug.txt"
179179
mode: 0644
180180
when:
181-
- csv_describe_result.stdout != ""
182-
- operator_container_result.stdout != ""
181+
- csv_describe_result.stdout|length > 0
182+
- operator_container_result.stdout|length > 0
183183

184184
- name: "Get the catalogsource pod log"
185185
shell: >
@@ -233,7 +233,7 @@
233233
- name: "Get replicaset logs for operators that failed olm-deployment output"
234234
shell: >
235235
"{{ oc_bin_path }} get replicasets -o
236-
go-template={%raw%}'{{range .items}}{{.status.conditions}}{{\"\\n\"}}{{end}}'{%endraw%}
236+
go-template={%raw%}'{{ range .items }}{{ .status.conditions }}{{ \"\\n\" }}{{ end }}'{%endraw%}
237237
-n {{ openshift_namespace }}"
238238
register: olm_replicaset_output
239239
environment:

roles/deploy_olm_operator_upstream/tasks/main.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
when:
4242
- quay_release_result is defined
4343
- quay_release_result.stdout is defined
44-
- quay_release_result.stdout != ""
44+
- quay_release_result.stdout|length > 0
4545
- quay_release_result.stdout != "null"
4646

4747
- name: "Set quay release to the incremented one if exists"
@@ -50,7 +50,7 @@
5050
when:
5151
- quay_increment_release_result is defined
5252
- quay_increment_release_result.stdout is defined
53-
- quay_increment_release_result.stdout != ""
53+
- quay_increment_release_result.stdout|length > 0
5454

5555
- name: "Append the -test suffix to the packageName"
5656
shell: "{{ yq_bin_path }} w -i {{ package_path }} 'packageName' '{{ package_name }}-test'"
@@ -165,7 +165,7 @@
165165
shell: "{{ oc_bin_path }} create -f {{ operator_work_dir }}/../scorecard.secret.yaml"
166166
environment:
167167
KUBECONFIG: "{{ kubeconfig_path }}"
168-
when: scorecard_secret_result.stat.exists == True
168+
when: scorecard_secret_result.stat.exists
169169
when: not run_upstream|bool
170170

171171
- name: "Wait for the operator {{ package_name }} to be in packagemanifests"
@@ -219,7 +219,7 @@
219219
content: "{{ csv_describe_result.stdout }}"
220220
dest: "{{ work_dir }}/olm-operator-csv-debug.txt"
221221
mode: 0644
222-
when: csv_describe_result.stdout != ""
222+
when: csv_describe_result.stdout|length > 0
223223

224224
- name: "Get the pod status of the deployed operator"
225225
shell: >
@@ -230,16 +230,16 @@
230230
ignore_errors: true
231231
environment:
232232
KUBECONFIG: "{{ kubeconfig_path }}"
233-
when: csv_describe_result.stdout != ""
233+
when: csv_describe_result.stdout|length > 0
234234

235235
- name: "Output the operator pod log to a debug file"
236236
copy:
237237
content: "{{ operator_pod_result.stdout }}"
238238
dest: "{{ work_dir }}/olm-operator-pod-debug.txt"
239239
mode: 0644
240240
when:
241-
- csv_describe_result.stdout != ""
242-
- operator_pod_result.stdout != ""
241+
- csv_describe_result.stdout|length > 0
242+
- operator_pod_result.stdout|length > 0
243243

244244
- name: "Get the pod container logs of the deployed operator"
245245
shell: >
@@ -250,16 +250,16 @@
250250
ignore_errors: true
251251
environment:
252252
KUBECONFIG: "{{ kubeconfig_path }}"
253-
when: csv_describe_result.stdout != ""
253+
when: csv_describe_result.stdout|length > 0
254254

255255
- name: "Output the operator container log to a debug file"
256256
copy:
257257
content: "{{ operator_container_result.stdout }}"
258258
dest: "{{ work_dir }}/olm-operator-container-debug.txt"
259259
mode: 0644
260260
when:
261-
- csv_describe_result.stdout != ""
262-
- operator_container_result.stdout != ""
261+
- csv_describe_result.stdout|length > 0
262+
- operator_container_result.stdout|length > 0
263263

264264
- name: "Get the catalogsource pod log"
265265
shell: >

roles/deploy_olm_operator_upstream_bundle/tasks/main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
- set_fact:
2+
- name: "Set initial data"
3+
set_fact:
34
quay_release: "0.0.1"
45
upstream_namespace_param: "{{ '-n test-operators' if run_upstream else '' }}"
56
olm_operator_files_path: /tmp/operator-test/olm-operator-files
@@ -112,7 +113,7 @@
112113
content: "{{ csv_describe_result.stdout }}"
113114
dest: "{{ work_dir }}/olm-operator-csv-debug.txt"
114115
mode: 0644
115-
when: csv_describe_result.stdout != ""
116+
when: csv_describe_result.stdout|length > 0
116117

117118
- name: "Get the pod status of the deployed operator"
118119
shell: >
@@ -122,16 +123,16 @@
122123
ignore_errors: true
123124
environment:
124125
KUBECONFIG: "{{ kubeconfig_path }}"
125-
when: csv_describe_result.stdout != ""
126+
when: csv_describe_result.stdout|length > 0
126127

127128
- name: "Output the operator pod log to a debug file"
128129
copy:
129130
content: "{{ operator_pod_result.stdout }}"
130131
dest: "{{ work_dir }}/olm-operator-pod-debug.txt"
131132
mode: 0644
132133
when:
133-
- csv_describe_result.stdout != ""
134-
- operator_pod_result.stdout != ""
134+
- csv_describe_result.stdout|length > 0
135+
- operator_pod_result.stdout|length > 0
135136

136137
- name: "Get the pod container logs of the deployed operator"
137138
shell: >
@@ -141,16 +142,16 @@
141142
ignore_errors: true
142143
environment:
143144
KUBECONFIG: "{{ kubeconfig_path }}"
144-
when: csv_describe_result.stdout != ""
145+
when: csv_describe_result.stdout|length > 0
145146

146147
- name: "Output the operator container log to a debug file"
147148
copy:
148149
content: "{{ operator_container_result.stdout }}"
149150
dest: "{{ work_dir }}/olm-operator-container-debug.txt"
150151
mode: 0644
151152
when:
152-
- csv_describe_result.stdout != ""
153-
- operator_container_result.stdout != ""
153+
- csv_describe_result.stdout|length > 0
154+
- operator_container_result.stdout|length > 0
154155

155156
- name: "Get the catalogsource pod log (upstream)"
156157
shell: >

roles/detect_format/tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
- name: Handle operator input image conversion
33
block:
4-
- set_fact:
4+
- name: "Set image protocol"
5+
set_fact:
56
image_protocol: "docker-daemon:"
67
- name: Handle operator image input
78
include_role:

roles/export_csv/tasks/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
file_type: file
2929
patterns: '*.clusterserviceversion.yaml'
3030
register: csv_find_manifest
31-
- fail:
31+
- name: "Fail if there are no csv files"
32+
fail:
3233
msg: "Could not find csv file in '{{ op_csv_dir }}'"
3334
when: csv_find_manifest.files|length == 0
34-
- set_fact:
35+
- name: "Set file path"
36+
set_fact:
3537
csv_file_path: "{{ csv_find_manifest.files[0].path }}"
3638
when: operator_format == "manifest"
3739

0 commit comments

Comments
 (0)