Skip to content

Commit

Permalink
Scope the global configs by the test namespace
Browse files Browse the repository at this point in the history
Signed-off-by: MOZGIII <[email protected]>
  • Loading branch information
MOZGIII committed Apr 30, 2020
1 parent edc1d73 commit 871c86a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions scripts/deploy-kubernetes-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ VECTOR_TEST_KUBECTL="${VECTOR_TEST_KUBECTL:-"kubectl"}"
# Allow optionally installing custom resource configs.
CUSTOM_RESOURCE_CONIFGS_FILE="${CUSTOM_RESOURCE_CONIFGS_FILE:-""}"


# TODO: replace with `helm template | kubectl apply -f -` when Helm Chart is
# available.

templated-config-global() {
sed "s|^ namespace: vector| namespace: $NAMESPACE|" < "distribution/kubernetes/vector-global.yaml" \
| sed "s|^ name: vector| name: $NAMESPACE|"
}

up() {
# A Vector container image to use.
CONTAINER_IMAGE="${CONTAINER_IMAGE:?"You must assing CONTAINER_IMAGE variable with the Vector container image name"}"

# Accept a custom set of resources via stdin.

# TODO: replace with `helm template | kubectl apply -f -` when Helm Chart is
# available.

sed "s|namespace: vector|namespace: $NAMESPACE|" < "distribution/kubernetes/vector-global.yaml" \
| $VECTOR_TEST_KUBECTL create -f -
templated-config-global | $VECTOR_TEST_KUBECTL create -f -

$VECTOR_TEST_KUBECTL create namespace "$NAMESPACE"

Expand All @@ -65,7 +68,7 @@ down() {

$VECTOR_TEST_KUBECTL delete namespace "$NAMESPACE"

$VECTOR_TEST_KUBECTL delete -f - < "distribution/kubernetes/vector-global.yaml"
templated-config-global | $VECTOR_TEST_KUBECTL delete -f -
}

case "$COMMAND" in
Expand Down

0 comments on commit 871c86a

Please sign in to comment.