Skip to content

Commit

Permalink
fix reading correct pipestatus in tf.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaguilar committed Jan 8, 2022
1 parent fe27739 commit aa99cf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/terraform_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func newRunOptions(tf *tfv1alpha1.Terraform) RunOptions {
tfName := tf.Name
name := tf.Status.PodNamePrefix
versionedName := name + "-v" + fmt.Sprint(tf.Generation)
terraformRunner := "isaaguilar/tf-runner-v5alpha6"
terraformRunner := "isaaguilar/tf-runner-v5beta1"
terraformRunnerPullPolicy := corev1.PullIfNotPresent
terraformVersion := "1.1.2"
terraformVersion := "1.1.3"

scriptRunner := "isaaguilar/script-runner"
scriptRunnerPullPolicy := corev1.PullIfNotPresent
Expand Down
2 changes: 1 addition & 1 deletion terraform-runner/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fi
##
## Build tf-runner(s)
##
TF_RUNNER_IMAGE_NAME="tf-runner-v5alpha6"
TF_RUNNER_IMAGE_NAME="tf-runner-v5beta1"
printf "\n\n----------------\nFetching available hashicorp/terraform versions"
i=0
BUILT_TF_RUNNER_IMAGES=($(
Expand Down
4 changes: 2 additions & 2 deletions terraform-runner/tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ case "$TFO_RUNNER" in
terraform apply tfplan 2>&1 | tee "$out"/"$TFO_RUNNER".out
;;
esac

if [[ ${PIPESTATUS[0]} -gt 0 ]];then exit ${PIPESTATUS[0]};fi
status=${PIPESTATUS[0]}
if [[ $status -gt 0 ]];then exit $status;fi

if [[ "$TFO_RUNNER" == "apply" ]] && [[ "$TFO_SAVE_OUTPUTS" == "true" ]]; then
# On sccessful apply, save outputs as k8s-secret
Expand Down

0 comments on commit aa99cf8

Please sign in to comment.