Skip to content

Commit

Permalink
Merge "Add Zuul Job to test operator's code vulnerabilities"
Browse files Browse the repository at this point in the history
  • Loading branch information
Microzuul CI authored and Gerrit Code Review committed Jul 15, 2024
2 parents cc91461 + 4b5a755 commit 4504dec
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions playbooks/run-golang-vuln.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- hosts: "{{ hostname | default('controller') }}"
tasks:
- name: Add golang to PATH
ansible.builtin.copy:
dest: /etc/profile.d/golang-path.sh
content: "export PATH=$PATH:/usr/local/go/bin/"
mode: "0644"
become: true

- name: Installing golang vulnerability tool
ansible.builtin.command:
cmd: go install golang.org/x/vuln/cmd/govulncheck@latest
environment:
GOPATH: /usr/local/go/
become: true
become_flags: "-i"

- name: Running golang vulnerability test
ansible.builtin.command:
cmd: govulncheck -show verbose ./...
chdir: "{{ zuul.project.src_dir }}"
no_log: false
17 changes: 17 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,20 @@
nodes:
- name: controller
label: cloud-centos-9-small

- job:
name: sf-operator-golang-env
parent: golang-go
vars:
go_command: "install golang.org/x/vuln/cmd/govulncheck@latest"
go_version: 1.22.2
nodeset:
nodes:
- name: controller
label: cloud-centos-9

- job:
name: sf-operator-golang-vulnerability-test
parent: sf-operator-golang-env
voting: false
run: playbooks/run-golang-vuln.yaml
1 change: 1 addition & 0 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- project:
check:
jobs:
- sf-operator-golang-vulnerability-test
- sf-operator-olm
- sf-operator-upgrade
- sf-operator-standalone
Expand Down

0 comments on commit 4504dec

Please sign in to comment.