Skip to content

Commit

Permalink
build: Revert "build: allowing for the infracosts to be optional, as …
Browse files Browse the repository at this point in the history
…they break on the mac due to an lack of arm64 images"

This reverts commit b1eb414.
  • Loading branch information
gambol99 committed Sep 3, 2024
1 parent a89872f commit b3d9c16
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
7 changes: 0 additions & 7 deletions test/e2e/integration/clean-protection.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ controller:
controller: "ghcr.io/appvia/terranetes-controller:${VERSION}"
executor: "ghcr.io/appvia/terranetes-executor:${VERSION}"
preload: "ghcr.io/appvia/terranetes-executor:${VERSION}"
EOF
if [[ "${INFRACOST_API_KEY}" != "" ]]; then
cat <<EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
Expand All @@ -48,13 +45,9 @@ EOF
cat <<EOF > ${BATS_TMPDIR}/my_values.yaml
controller:
enableNamespaceProtection: false
EOF
if [[ "${INFRACOST_API_KEY}" != "" ]]; then
cat <<EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
fi
fi

runit "helm upgrade terranetes-controller ${CHART} -n ${NAMESPACE} --values ${BATS_TMPDIR}/my_values.yaml"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/cloud/aws/costs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ teardown() {
}

@test "We should have a token for the infracost integration" {
[[ -n $INFRACOST_API_KEY ]] || touch ${BATS_PARENT_TMPNAME}.skip
[[ -n $INFRACOST_TOKEN ]] || touch ${BATS_PARENT_TMPNAME}.skip
}

@test "We should be able to create a configuration which costs money on aws" {
Expand Down
11 changes: 0 additions & 11 deletions test/e2e/integration/custom-state-backend.bats
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ controller:
controller: "ghcr.io/appvia/terranetes-controller:${VERSION}"
executor: "ghcr.io/appvia/terranetes-executor:${VERSION}"
preload: "ghcr.io/appvia/terranetes-executor:${VERSION}"
EOF
if [[ "${INFRACOST_API_KEY}" != "" ]]; then
cat << EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
Expand Down Expand Up @@ -229,24 +226,16 @@ controller:
controller: "ghcr.io/appvia/terranetes-controller:${VERSION}"
executor: "ghcr.io/appvia/terranetes-executor:${VERSION}"
preload: "ghcr.io/appvia/terranetes-executor:${VERSION}"
EOF
if [[ "${INFRACOST_API_KEY}" != "" ]]; then
cat << EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
fi
else
CHART="appvia/terranetes-controller"
cat << EOF > ${BATS_TMPDIR}/my_values.yaml
controller:
EOF
if [[ "${INFRACOST_API_KEY}" != "" ]]; then
cat << EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
fi
fi

runit "helm upgrade terranetes-controller ${CHART} -n ${NAMESPACE} --values ${BATS_TMPDIR}/my_values.yaml"
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/integration/infracost.bats
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ teardown() {
}

@test "We should see infracost breakdown in the watcher logs" {
[[ -z ${INFRACOST_API_KEY} ]] && touch ${BATS_PARENT_TMPNAME}.skip

POD=$(kubectl -n ${APP_NAMESPACE} get pod -l terraform.appvia.io/configuration=${RESOURCE_NAME} -l terraform.appvia.io/stage=plan -o json | jq -r '.items[0].metadata.name')
[[ $status -eq 0 ]]

Expand Down
18 changes: 4 additions & 14 deletions test/e2e/integration/setup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,18 @@ controller:
controller: "ghcr.io/appvia/terranetes-controller:${VERSION}"
executor: "ghcr.io/appvia/terranetes-executor:${VERSION}"
preload:: "ghcr.io/appvia/terranetes-executor:${VERSION}"
costs:
secret: infracost-api
EOF

if [[ ${INFRACOST_API_KEY} != "" ]]; then
cat << EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
fi
else
CHART="appvia/terranetes-controller"

cat << EOF > ${BATS_TMPDIR}/my_values.yaml
controller:
enableNamespaceProtection: true
costs:
secret: infracost-api
EOF
if [[ ${INFRACOST_API_KEY} != "" ]]; then
cat << EOF >> ${BATS_TMPDIR}/my_values.yaml
costs:
secret: infracost-api
EOF
fi
fi

runit "helm upgrade --install terranetes-controller ${CHART} -n ${NAMESPACE} --create-namespace --values ${BATS_TMPDIR}/my_values.yaml"
Expand Down Expand Up @@ -105,7 +96,6 @@ metadata:
kubernetes.io/metadata.name: apps
name: ${APP_NAMESPACE}
EOF

runit "kubectl apply -f ${BATS_TMPDIR}/resource.yaml"
[[ $status -eq 0 ]]
runit "kubectl -n ${APP_NAMESPACE} delete job --all --wait=false"
Expand Down

0 comments on commit b3d9c16

Please sign in to comment.