Skip to content

Commit 704eb70

Browse files
committed
Extend the CI pipeline with bandit, safety and pdm check
These 3 tools have been added to the tox CI pipeline and bunch of yaml lint violation have been fixed.
1 parent 9c7e08e commit 704eb70

32 files changed

+944
-528
lines changed

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
repos:
23
- repo: https://github.com/zricethezav/gitleaks
34
rev: v8.16.0

.yamllint

+7
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ rules:
55
line-length:
66
level: warning
77
max: 180
8+
document-start:
9+
level: error
10+
11+
ignore:
12+
- .tox/
13+
- ansible/vaults/
14+
- .venv

ansible/inventory/group_vars/clusters.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
ansible_connection: local
23

34
# Index signature verification vars
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
---
12
ocp_host: https://api.crc.testing:6443
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
---
12
ocp_host: https://api.pipelines-prod.ijdb.p1.openshiftapps.com:6443
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
---
12
ocp_host: https://api.pipelines-stage.0ce8.p1.openshiftapps.com:6443
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
k8s_validate_certs: yes
1+
---
2+
k8s_validate_certs: true
23
pipelinerun_listener_namespace: pipelinerun-listener

ansible/roles/config-ocp-cluster/tasks/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
- name: Customize TektonConfig
23
k8s:
34
state: present

ansible/roles/config-ocp-cluster/tasks/pipelinerun-listener.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
---
12
- name: Create PipelineRun listener resources
23
tags:
34
- pipelinerun-listener
45
block:
56
- name: Create Namespace
67
k8s:
78
state: present
8-
apply: yes
9+
apply: true
910
validate_certs: "{{ k8s_validate_certs }}"
1011
definition:
1112
kind: Namespace
@@ -20,18 +21,18 @@
2021
- name: Create Tasks
2122
k8s:
2223
state: present
23-
apply: yes
24+
apply: true
2425
validate_certs: "{{ k8s_validate_certs }}"
2526
namespace: "{{ pipelinerun_listener_namespace }}"
2627
definition: "{{ lookup('file', '{{ item }}') }}"
2728
with_fileglob:
2829
- ../files/tasks/*
2930

3031
- name: Create Google Chat webhook Secret
31-
no_log: yes
32+
no_log: true
3233
k8s:
3334
state: present
34-
force: yes
35+
force: true
3536
validate_certs: "{{ k8s_validate_certs }}"
3637
namespace: "{{ pipelinerun_listener_namespace }}"
3738
definition:
@@ -46,7 +47,7 @@
4647
- name: Create TriggerBinding
4748
k8s:
4849
state: present
49-
apply: yes
50+
apply: true
5051
namespace: "{{ pipelinerun_listener_namespace }}"
5152
validate_certs: "{{ k8s_validate_certs }}"
5253
definition:
@@ -66,7 +67,7 @@
6667
- name: Create TriggerTemplate
6768
k8s:
6869
state: present
69-
apply: yes
70+
apply: true
7071
namespace: "{{ pipelinerun_listener_namespace }}"
7172
validate_certs: "{{ k8s_validate_certs }}"
7273
definition:
@@ -102,7 +103,7 @@
102103
- name: Create EventListener
103104
k8s:
104105
state: present
105-
apply: yes
106+
apply: true
106107
namespace: "{{ pipelinerun_listener_namespace }}"
107108
validate_certs: "{{ k8s_validate_certs }}"
108109
definition:
@@ -135,7 +136,7 @@
135136
- name: Create ClusterRoleBinding
136137
k8s:
137138
state: present
138-
apply: yes
139+
apply: true
139140
namespace: "{{ pipelinerun_listener_namespace }}"
140141
validate_certs: "{{ k8s_validate_certs }}"
141142
definition:
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
k8s_validate_certs: yes
1+
---
2+
k8s_validate_certs: true
23
k8s_namespace: index-signature-verification

ansible/roles/index-signature-verification/files/configmaps/index-signature-verification-config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: v1
23
kind: ConfigMap
34
metadata:

ansible/roles/index-signature-verification/tasks/main.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
---
12
- name: Create Namespace
23
k8s:
34
state: present
4-
apply: yes
5+
apply: true
56
validate_certs: "{{ k8s_validate_certs }}"
67
definition:
78
kind: Namespace
@@ -12,7 +13,7 @@
1213
- name: Create ConfigMaps
1314
k8s:
1415
state: present
15-
apply: yes
16+
apply: true
1617
validate_certs: "{{ k8s_validate_certs }}"
1718
namespace: "{{ k8s_namespace }}"
1819
definition: "{{ lookup('file', '{{ item }}') }}"
@@ -22,7 +23,7 @@
2223
- name: Create Tasks
2324
k8s:
2425
state: present
25-
apply: yes
26+
apply: true
2627
validate_certs: "{{ k8s_validate_certs }}"
2728
namespace: "{{ k8s_namespace }}"
2829
definition: "{{ lookup('file', '{{ item }}') }}"
@@ -32,7 +33,7 @@
3233
- name: Create Pipelines
3334
k8s:
3435
state: present
35-
apply: yes
36+
apply: true
3637
validate_certs: "{{ k8s_validate_certs }}"
3738
namespace: "{{ k8s_namespace }}"
3839
definition: "{{ lookup('file', '{{ item }}') }}"
@@ -42,7 +43,7 @@
4243
- name: Create EventListener
4344
k8s:
4445
state: present
45-
apply: yes
46+
apply: true
4647
validate_certs: "{{ k8s_validate_certs }}"
4748
namespace: "{{ k8s_namespace }}"
4849
definition:
@@ -61,7 +62,7 @@
6162
- name: Create TriggerBinding
6263
k8s:
6364
state: present
64-
apply: yes
65+
apply: true
6566
validate_certs: "{{ k8s_validate_certs }}"
6667
namespace: "{{ k8s_namespace }}"
6768
definition:
@@ -73,7 +74,7 @@
7374
- name: Create TriggerTemplate
7475
k8s:
7576
state: present
76-
apply: yes
77+
apply: true
7778
validate_certs: "{{ k8s_validate_certs }}"
7879
namespace: "{{ k8s_namespace }}"
7980
definition:
@@ -97,10 +98,10 @@
9798
secretName: registry-auth-secret
9899

99100
- name: Create registry auth Secret
100-
no_log: yes
101+
no_log: true
101102
k8s:
102103
state: present
103-
force: yes
104+
force: true
104105
validate_certs: "{{ k8s_validate_certs }}"
105106
namespace: "{{ k8s_namespace }}"
106107
definition:
@@ -115,7 +116,7 @@
115116
- name: Create CronJob
116117
k8s:
117118
state: present
118-
apply: yes
119+
apply: true
119120
validate_certs: "{{ k8s_validate_certs }}"
120121
namespace: "{{ k8s_namespace }}"
121122
definition:

ansible/roles/integration-tests/tasks/tools.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
unarchive:
1313
src: https://mirror.openshift.com/pub/openshift-v4/clients/pipeline/0.17.2/tkn-linux-amd64-0.17.2.tar.gz
1414
dest: "{{ temp_tools_dir.path }}"
15-
remote_src: yes
15+
remote_src: true
1616
include:
1717
- tkn

ansible/roles/nginx-proxy/tasks/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- name: Create nginx config
66
k8s:
77
state: present
8-
apply: yes
8+
apply: true
99
namespace: "{{ oc_namespace }}"
1010
definition: "{{ lookup('template', '{{ item }}') }}"
1111
with_items:
@@ -14,7 +14,7 @@
1414
- name: Deploy nginx
1515
k8s:
1616
state: present
17-
apply: yes
17+
apply: true
1818
namespace: "{{ oc_namespace }}"
1919
definition: "{{ lookup('template', '{{ item }}') }}"
2020
with_items:
@@ -24,7 +24,7 @@
2424
- name: Create service
2525
k8s:
2626
state: present
27-
apply: yes
27+
apply: true
2828
namespace: "{{ oc_namespace }}"
2929
definition: "{{ lookup('template', '{{ item }}') }}"
3030
with_items:
@@ -33,7 +33,7 @@
3333
- name: Create route
3434
k8s:
3535
state: present
36-
apply: yes
36+
apply: true
3737
namespace: "{{ oc_namespace }}"
3838
definition: "{{ lookup('template', '{{ item }}') }}"
3939
with_items:

ansible/roles/nginx-proxy/tasks/secrets.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
- name: Create htpasswd nginx secret file
3-
no_log: yes
3+
no_log: true
44
tags:
55
- secrets
66
k8s:
77
state: present
8-
force: yes
8+
force: true
99
namespace: "{{ oc_namespace }}"
1010
definition:
1111
apiVersion: v1

ansible/roles/nginx-proxy/templates/openshift/nginx-deployment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ spec:
4040
args:
4141
- 'nginx -g "daemon off;error_log /dev/stdout debug;" -c /etc/nginx/nginx-config/nginx.conf'
4242
ports:
43-
- containerPort: {{ nginx_port | int }} # yamllint disable-line rule:braces
43+
- containerPort: {{ nginx_port | int }} # yamllint disable-line rule:braces
4444
protocol: TCP
4545
livenessProbe:
4646
failureThreshold: 3
4747
httpGet:
4848
path: /_proxy/ping
49-
port: {{ nginx_port | int }} # yamllint disable-line rule:braces
49+
port: {{ nginx_port | int }} # yamllint disable-line rule:braces
5050
initialDelaySeconds: 60
5151
periodSeconds: 30
5252
successThreshold: 1
5353
timeoutSeconds: 10
5454
readinessProbe:
5555
httpGet:
5656
path: /_proxy/ping
57-
port: {{ nginx_port | int }} # yamllint disable-line rule:braces
57+
port: {{ nginx_port | int }} # yamllint disable-line rule:braces
5858
initialDelaySeconds: 15
5959
timeoutSeconds: 20
6060
volumeMounts:

ansible/roles/nginx-proxy/templates/openshift/nginx-service.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
ports:
1212
- name: http
1313
port: 80
14-
targetPort: {{ nginx_port | int }} # yamllint disable-line rule:braces
14+
targetPort: {{ nginx_port | int }} # yamllint disable-line rule:braces
1515
selector:
1616
app: "{{ nginx_proxy_name }}"
1717
env: "{{ env }}"

ansible/roles/operator-pipeline/tasks/community-signing-secrets.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22

33
- name: Create Community pipeline cert secret
4-
no_log: yes
4+
no_log: true
55
k8s:
66
state: present
7-
force: yes
7+
force: true
88
namespace: "{{ oc_namespace }}"
99
definition:
1010
apiVersion: v1
@@ -21,12 +21,12 @@
2121
community-operator-signing-pipeline.pem: "{{ lookup('file', community_signing_pipeline_private_cert_local_path, rstrip=False) | b64encode }}"
2222

2323
- name: Create signing pub key secret
24-
no_log: yes
24+
no_log: true
2525
tags:
2626
- secrets
2727
k8s:
2828
state: present
29-
force: yes
29+
force: true
3030
namespace: "{{ oc_namespace }}"
3131
definition:
3232
apiVersion: v1

ansible/roles/operator-pipeline/tasks/community-signing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- community-signing
88
k8s:
99
state: present
10-
apply: yes
10+
apply: true
1111
namespace: "{{ oc_namespace }}"
1212
definition: "{{ lookup('template', '{{ item }}') }}"
1313
with_items:

ansible/roles/operator-pipeline/tasks/operator-pipeline-import-index-images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- name: Import certified-operator-index imagestream
55
tags:
66
- import-index-images
7-
no_log: yes
7+
no_log: true
88
uri:
99
url: "{{ ocp_host }}/apis/image.openshift.io/v1/namespaces/{{ oc_namespace }}/imagestreamimports"
1010
method: POST

ansible/roles/operator-pipeline/tasks/operator-pipeline-webhooks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
- name: Configure GitHub webhooks
23
loop: "{{ operator_pipeline_github_webhook_repos }}"
34
when: operator_pipeline_github_webhook_repos is defined

0 commit comments

Comments
 (0)