diff --git a/.vib/consul-exporter/goss/consul-exporter.yaml b/.vib/consul-exporter/goss/consul-exporter.yaml new file mode 100644 index 000000000000..5b1dea4aff8a --- /dev/null +++ b/.vib/consul-exporter/goss/consul-exporter.yaml @@ -0,0 +1,9 @@ +command: + check-consul-exporter-run: + exec: timeout --preserve-status 5 consul_exporter + timeout: 8000 + exit-status: 143 + stderr: + - "Starting consul_exporter" + - "Listening on" + - "version={{ .Env.APP_VERSION }}" diff --git a/.vib/consul-exporter/goss/goss.yaml b/.vib/consul-exporter/goss/goss.yaml new file mode 100644 index 000000000000..a8b838bd6329 --- /dev/null +++ b/.vib/consul-exporter/goss/goss.yaml @@ -0,0 +1,10 @@ +gossfile: + # Goss tests exclusive to the current container + ../../consul-exporter/goss/consul-exporter.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/consul-exporter/goss/vars.yaml b/.vib/consul-exporter/goss/vars.yaml new file mode 100644 index 000000000000..a2d8d2109b8f --- /dev/null +++ b/.vib/consul-exporter/goss/vars.yaml @@ -0,0 +1,3 @@ +binaries: + - consul_exporter +root_dir: /opt/bitnami diff --git a/.vib/consul-exporter/vib-publish.json b/.vib/consul-exporter/vib-publish.json index 8b6fe8eab4e6..b45f4e46ed86 100644 --- a/.vib/consul-exporter/vib-publish.json +++ b/.vib/consul-exporter/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -33,6 +34,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "consul-exporter/goss/goss.yaml", + "vars_file": "consul-exporter/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-consul-exporter" + } + } + } + }, { "action_id": "trivy", "params": { @@ -77,9 +93,9 @@ "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}" + } } } } diff --git a/.vib/consul-exporter/vib-verify.json b/.vib/consul-exporter/vib-verify.json index a34e8aee9161..96ffe2e2b761 100644 --- a/.vib/consul-exporter/vib-verify.json +++ b/.vib/consul-exporter/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -29,6 +30,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "consul-exporter/goss/goss.yaml", + "vars_file": "consul-exporter/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-consul-exporter" + } + } + } + }, { "action_id": "trivy", "params": {