From 70641dc62b81ba8de580fb3a16101a1c40315322 Mon Sep 17 00:00:00 2001 From: Francisco de Paz Galan Date: Fri, 26 May 2023 16:52:38 +0200 Subject: [PATCH] [bitnami/fluxcd-image-automation-controller] Add VIB tests (#35286) * [bitnami/fluxcd-image-automation-controller] Add VIB tests Signed-off-by: FraPazGal * Remove unused vars Signed-off-by: FraPazGal * Fix binary name Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal * Add binary check and trigger VIB Signed-off-by: FraPazGal * Remove VIB trigger Signed-off-by: FraPazGal --------- Signed-off-by: FraPazGal --- .../fluxcd-image-automation-controller.yaml | 6 +++++ .../goss/goss.yaml | 9 +++++++ .../goss/vars.yaml | 3 +++ .../vib-publish.json | 24 +++++++++++++++---- .../vib-verify.json | 18 +++++++++++++- 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 .vib/fluxcd-image-automation-controller/goss/fluxcd-image-automation-controller.yaml create mode 100644 .vib/fluxcd-image-automation-controller/goss/goss.yaml create mode 100644 .vib/fluxcd-image-automation-controller/goss/vars.yaml diff --git a/.vib/fluxcd-image-automation-controller/goss/fluxcd-image-automation-controller.yaml b/.vib/fluxcd-image-automation-controller/goss/fluxcd-image-automation-controller.yaml new file mode 100644 index 000000000000..396c15803f63 --- /dev/null +++ b/.vib/fluxcd-image-automation-controller/goss/fluxcd-image-automation-controller.yaml @@ -0,0 +1,6 @@ +command: + check-image-automation-controller-binary: + exec: image-automation-controller --help + exit-status: 2 + stderr: + - "Usage of image-automation-controller" diff --git a/.vib/fluxcd-image-automation-controller/goss/goss.yaml b/.vib/fluxcd-image-automation-controller/goss/goss.yaml new file mode 100644 index 000000000000..3ccb9e0223a3 --- /dev/null +++ b/.vib/fluxcd-image-automation-controller/goss/goss.yaml @@ -0,0 +1,9 @@ +gossfile: + ../../fluxcd-image-automation-controller/goss/fluxcd-image-automation-controller.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/fluxcd-image-automation-controller/goss/vars.yaml b/.vib/fluxcd-image-automation-controller/goss/vars.yaml new file mode 100644 index 000000000000..eae3325b030d --- /dev/null +++ b/.vib/fluxcd-image-automation-controller/goss/vars.yaml @@ -0,0 +1,3 @@ +binaries: + - image-automation-controller +root_dir: /opt/bitnami diff --git a/.vib/fluxcd-image-automation-controller/vib-publish.json b/.vib/fluxcd-image-automation-controller/vib-publish.json index 8b6fe8eab4e6..001875b317f3 100644 --- a/.vib/fluxcd-image-automation-controller/vib-publish.json +++ b/.vib/fluxcd-image-automation-controller/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -77,9 +78,24 @@ "url": "{VIB_ENV_PACKAGES_JSON_URL}", "path": "/{VIB_ENV_PATH}", "authn": { - "header": "Authorization", - "token": "Bearer {VIB_ENV_GITHUB_TOKEN}" - } + "header": "Authorization", + "token": "Bearer {VIB_ENV_GITHUB_TOKEN}" + } + } + } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "fluxcd-image-automation-controller/goss/goss.yaml", + "vars_file": "fluxcd-image-automation-controller/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-fluxcd-image-automation-controller" + } } } } diff --git a/.vib/fluxcd-image-automation-controller/vib-verify.json b/.vib/fluxcd-image-automation-controller/vib-verify.json index a34e8aee9161..2ec592aa3684 100644 --- a/.vib/fluxcd-image-automation-controller/vib-verify.json +++ b/.vib/fluxcd-image-automation-controller/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -46,6 +47,21 @@ "OS" ] } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "fluxcd-image-automation-controller/goss/goss.yaml", + "vars_file": "fluxcd-image-automation-controller/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-fluxcd-image-automation-controller" + } + } + } } ] }