From 7f3b1f8e94f467bc0138da8e51107207249a02a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n=20Garc=C3=ADa?= Date: Fri, 7 Feb 2025 13:54:23 +0100 Subject: [PATCH] [bitnami/cloudnative-pg] ci: :construction_worker: Add VIB files (#77074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [bitnami/cloudnative-pg] ci: :construction_worker: Add VIB files Signed-off-by: Javier J. Salmerón García * test: :white_check_mark: Add goss Signed-off-by: Javier J. Salmerón García --------- Signed-off-by: Javier J. Salmerón García --- .vib/cloudnative-pg/goss/cloudnative-pg.yaml | 17 +++++ .vib/cloudnative-pg/goss/goss.yaml | 9 +++ .vib/cloudnative-pg/goss/vars.yaml | 7 ++ .vib/cloudnative-pg/vib-verify.json | 73 ++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 .vib/cloudnative-pg/goss/cloudnative-pg.yaml create mode 100644 .vib/cloudnative-pg/goss/goss.yaml create mode 100644 .vib/cloudnative-pg/goss/vars.yaml create mode 100644 .vib/cloudnative-pg/vib-verify.json diff --git a/.vib/cloudnative-pg/goss/cloudnative-pg.yaml b/.vib/cloudnative-pg/goss/cloudnative-pg.yaml new file mode 100644 index 000000000000..f5459b9052d1 --- /dev/null +++ b/.vib/cloudnative-pg/goss/cloudnative-pg.yaml @@ -0,0 +1,17 @@ +command: + check-cloudnative-pg-version: + exec: + - /manager + - version + exit-status: 0 + # Replace "-" with "+" in the version string + stdout: + - {{ .Env.APP_VERSION | replace "-" "+" }} + check-cloudnative-pg-help: + exec: + - /manager + - help + exit-status: 0 + # Replace "-" with "+" in the version string + stdout: + - pgbouncer management diff --git a/.vib/cloudnative-pg/goss/goss.yaml b/.vib/cloudnative-pg/goss/goss.yaml new file mode 100644 index 000000000000..124ee1a658ef --- /dev/null +++ b/.vib/cloudnative-pg/goss/goss.yaml @@ -0,0 +1,9 @@ +# Copyright Broadcom, Inc. All Rights Reserved. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Goss tests exclusive to the current container + ../../cloudnative-pg/goss/cloudnative-pg.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-files.yaml: {} diff --git a/.vib/cloudnative-pg/goss/vars.yaml b/.vib/cloudnative-pg/goss/vars.yaml new file mode 100644 index 000000000000..76f616728356 --- /dev/null +++ b/.vib/cloudnative-pg/goss/vars.yaml @@ -0,0 +1,7 @@ +files: + - mode: "0644" + paths: + - /opt/bitnami/cloudnative-pg/.spdx-cloudnative-pg.spdx + - mode: "0755" + paths: + - /manager diff --git a/.vib/cloudnative-pg/vib-verify.json b/.vib/cloudnative-pg/vib-verify.json new file mode 100644 index 000000000000..64e6f88247e4 --- /dev/null +++ b/.vib/cloudnative-pg/vib-verify.json @@ -0,0 +1,73 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyIvc2hhcmVkL2J1c3lib3giLCAic2xlZXAiLCAiMzYwMCJdCg==" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64", + "linux/arm64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "cloudnative-pg/goss/goss.yaml", + "vars_file": "cloudnative-pg/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-cloudnative-pg" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "LOW", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + } + } +}