Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extras/kgoss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ GOSS\_PATH | Local location of a compatible goss binary to use in container | `$
GOSS\_FILES\_PATH | Location of the goss yaml files | `.`
GOSS\_KUBECTL\_BIN | Kubenetes client tool to use | `$(which kubectl)`
GOSS\_KUBECTL\_OPTS | Options to inject more options such as "--namespace=default" | ""
GOSS\_KUBECTL\_RUN\_OPTS | Options only for kubectl run (e.g. --overrides for serviceAccount) | ""
GOSS\_OPTS | Options to use for the goss test run. | `--color --format documentation`
GOSS\_WAIT\_OPTS | Options to use for the goss wait run, when `./goss_wait.yaml` exists. | `-r 30s -s 1s > /dev/null`
GOSS\_VARS | Variables file relative to `GOSS_FILES_PATH` to copy and use | ""
Expand Down
5 changes: 4 additions & 1 deletion extras/kgoss/kgoss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ If -p, -c and -a are not specified, container will run its ENTRYPOINT.

GOSS_KUBECTL_BIN="$(which kubectl)": location of kubectl-compatible binary
GOSS_KUBECTL_OPTS="": hook to inject more options such as "--namespace=default"
GOSS_KUBECTL_RUN_OPTS="": options only for kubectl run (e.g. --overrides for serviceAccount)
GOSS_PATH="$(which goss)": location of goss binary
GOSS_FILES_PATH=".": location of goss.yaml and other configuration files
GOSS_VARS="": path to a goss.vars file
Expand Down Expand Up @@ -74,6 +75,8 @@ GOSS_OPTS=${GOSS_OPTS:-"--color --format documentation"}
GOSS_WAIT_OPTS=${GOSS_WAIT_OPTS:-"-r 30s -s 1s > /dev/null"}
GOSS_CONTAINER_PATH=${GOSS_CONTAINER_PATH:-/tmp/goss}
GOSS_KUBECTL_OPTS=${GOSS_KUBECTL_OPTS:-""}
# GOSS_KUBECTL_RUN_OPTS: additional options only for kubectl run (e.g. --overrides for serviceAccount, nodeSelector)
GOSS_KUBECTL_RUN_OPTS=${GOSS_KUBECTL_RUN_OPTS:-""}

kgoss_cmd=run
image=
Expand Down Expand Up @@ -200,7 +203,7 @@ initialize () {
info "Creating Kubernetes pod/container to test"
test_pod_name=kgoss-tester-${RANDOM}
set -x
id=$(${k} run ${GOSS_KUBECTL_OPTS} $test_pod_name --image-pull-policy=Always --restart=Never \
id=$(${k} run ${GOSS_KUBECTL_OPTS} ${GOSS_KUBECTL_RUN_OPTS} $test_pod_name --image-pull-policy=Always --restart=Never \
--labels='app=kgoss-test' --output=jsonpath={.metadata.name} ${envs} \
--image=${image} ${to_exec} )
set +x
Expand Down