diff --git a/.vib/elasticsearch/goss/elasticsearch.yaml b/.vib/elasticsearch/goss/elasticsearch.yaml new file mode 100644 index 000000000000..969bcdccb606 --- /dev/null +++ b/.vib/elasticsearch/goss/elasticsearch.yaml @@ -0,0 +1,18 @@ +command: + # ES7 does not support using `elasticsearch --version` without properly configuring it + check-app-version: + exec: ls /opt/bitnami/elasticsearch/lib/elasticsearch-core-*.jar | grep {{ .Env.APP_VERSION }} + exit-status: 0 +file: + # Check x-pack is not included + /opt/bitnami/elasticsearch/bin/x-pack: + exists: false + /opt/bitnami/elasticsearch/modules/x-pack: + exists: false + /opt/bitnami/elasticsearch/config/log4j2.properties: + exists: true + filetype: file + contains: + - "Console" + - "!RollingFile" + - "!_old" \ No newline at end of file diff --git a/.vib/elasticsearch/goss/goss.yaml b/.vib/elasticsearch/goss/goss.yaml new file mode 100644 index 000000000000..6833737efef4 --- /dev/null +++ b/.vib/elasticsearch/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../elasticsearch/goss/elasticsearch.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-directories.yaml: {} + ../../common/goss/templates/check-files.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/elasticsearch/goss/vars.yaml b/.vib/elasticsearch/goss/vars.yaml new file mode 100644 index 000000000000..d96188fe1593 --- /dev/null +++ b/.vib/elasticsearch/goss/vars.yaml @@ -0,0 +1,22 @@ +binaries: + - elasticsearch + - gosu + - java + - yq +directories: + - mode: "0775" + paths: + - /bitnami/elasticsearch + - /bitnami/elasticsearch/data + - /bitnami/elasticsearch/plugins + - /opt/bitnami/elasticsearch/tmp + - /opt/bitnami/elasticsearch/logs + - /opt/bitnami/elasticsearch/plugins + - /opt/bitnami/elasticsearch/modules + - /opt/bitnami/elasticsearch/config + - /docker-entrypoint-initdb.d +files: + - paths: + - /opt/bitnami/elasticsearch/config/es_config.sample + - /opt/bitnami/elasticsearch/config/log4j2.file.properties +root_dir: /opt/bitnami diff --git a/.vib/elasticsearch/vib-publish.json b/.vib/elasticsearch/vib-publish.json index a484d2fc349a..190fdaf1ac95 100644 --- a/.vib/elasticsearch/vib-publish.json +++ b/.vib/elasticsearch/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": "elasticsearch/goss/goss.yaml", + "vars_file": "elasticsearch/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-elasticsearch" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/elasticsearch/vib-verify.json b/.vib/elasticsearch/vib-verify.json index a34e8aee9161..8d2229af356f 100644 --- a/.vib/elasticsearch/vib-verify.json +++ b/.vib/elasticsearch/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": "elasticsearch/goss/goss.yaml", + "vars_file": "elasticsearch/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-elasticsearch" + } + } + } + }, { "action_id": "trivy", "params": {