Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use opentofu binary in harness terraform image #217

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
24 changes: 11 additions & 13 deletions .github/workflows/publish-harness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,27 @@ jobs:
runs-on: ubuntu-20.04
needs: [publish-harness-base]
env:
TERRAFORM_VERSION: 1.8.2
TOFU_VERESION: 1.7.2
strategy:
matrix:
versions:
- full: 1.8.2
tag: 1.8.2
- full: 1.8.2
- tofu: 1.7.2
tag: "1.8"
- full: 1.7.5
- tofu: 1.7.1
tag: '1.7'
- full: 1.6.6
- tofu: 1.6.2
tag: '1.6'
- full: 1.5.7
- tofu: 1.6.2
tag: '1.5'
- full: 1.4.7
- tofu: 1.6.2
tag: '1.4'
- full: 1.3.10
- tofu: 1.6.2
tag: '1.3'
- full: 1.2.9
- tofu: 1.6.2
tag: '1.2'
- full: 1.1.9
- tofu: 1.6.2
tag: '1.1'
- full: 1.0.11
- tofu: 1.6.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these versions actually aligned? Looks like the tofu version is always 1.6.2?

Copy link
Contributor Author

@seemywingz seemywingz Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, according to OpenTofu Migration Docs

When migrating from Terraform 1.5.x or lower, please migrate to OpenTofu 1.6.2 first

But with a caveat:

This migration guide is only valid for Terraform 1.5.7. If you are on a Terraform version below 1.5.7, please upgrade to at least Terraform version 1.5.7 before proceeding with the migration by following the Terraform upgrade guide. If you are on a higher Terraform version, please select the appropriate migration guide for your Terraform version.

tag: '1.0'
permissions:
contents: write
Expand Down Expand Up @@ -169,7 +167,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
TERRAFORM_IMAGE_TAG=${{ matrix.versions.full }}
TOFU_IMAGE_TAG=${{ matrix.versions.tofu }}
HARNESS_BASE_IMAGE_REPO=ghcr.io/pluralsh/stackrun-harness-base
HARNESS_BASE_IMAGE_TAG=${{ needs.publish-harness-base.outputs.version }}

Expand Down
8 changes: 4 additions & 4 deletions dockerfiles/harness/terraform.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG TERRAFORM_IMAGE_TAG=1.8.2
ARG TERRAFORM_IMAGE=hashicorp/terraform:$TERRAFORM_IMAGE_TAG
ARG TOFU_IMAGE_TAG=1.7.1
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
ARG TOFU_IMAGE=ghcr.io/opentofu/opentofu:$TOFU_IMAGE_TAG

ARG HARNESS_BASE_IMAGE_TAG=latest
ARG HARNESS_BASE_IMAGE_REPO=harness-base
ARG HARNESS_BASE_IMAGE=$HARNESS_BASE_IMAGE_REPO:$HARNESS_BASE_IMAGE_TAG

FROM $TERRAFORM_IMAGE as terraform
FROM $TOFU_IMAGE as tofu
Fixed Show fixed Hide fixed
FROM $HARNESS_BASE_IMAGE as final

COPY --from=terraform /bin/terraform /bin/terraform
COPY --from=tofu /usr/local/bin/tofu /bin/terraform
Loading