From 125ec0d554dd931251a10a38d75b48362d20c17d Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Fri, 12 Aug 2022 00:27:45 +0700 Subject: [PATCH] bump version to v0.11.0, update docs, and changelog Signed-off-by: Chanwit Kaewkasi --- CHANGELOG.md | 22 +++++++++++--- charts/tf-controller/Chart.yaml | 4 +-- charts/tf-controller/values.yaml | 4 +-- config/manager/kustomization.yaml | 2 +- docs/release.yaml | 6 ++-- docs/use_cases.md | 49 ++++++++++++++++++++++++++++++- 6 files changed, 74 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64bc37be..be12c08f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes of this project are documented in this file. +# v0.11.0 + +**Release date:** 2022-08-12 + +This release is another milestone of the project as it is the first release of TF-controller +that supports Flux's OCIRepository. + +New Features and Bug Fixing: + * Added support for Flux's OCIRepository (@chanwit) + * Fixed EnvVars to pick up `valueFrom` to work with Secrets and ConfigMaps (@Nalum) + * Fixed tfctl to show plan in the working directory (@github-vincent-miszczak) + * Updated tfexec to v0.16.1 for the force-lock option (@chanwit) + * Updated the Source controller to v0.26.1 (@chanwit) + # v0.10.1 **Release date:** 2022-08-05 @@ -42,7 +56,7 @@ This pre-release contains the following changes. New Features: * Update Terraform binary to 1.1.9 (@chanwit) * Allow runner pod metadata customization (@tomhuang12) - * Support runner pod environment variables specification (@nalum) + * Support runner pod environment variables specification (@Nalum) * Implement `.spec.refreshBeforeApply` to refresh the state before apply (@chanwit) * Use controller runtime logging library in runner (@chanwit) @@ -58,11 +72,11 @@ Bug Fixing: This pre-release contains the following changes. New Features and Bug Fixing: - * Fix Helm chart to support image pull secrets for `tf-runner` Service Accounts (@nalum) + * Fix Helm chart to support image pull secrets for `tf-runner` Service Accounts (@Nalum) * Upgrade Source Controller API to v0.22.4 (@tomhuang12) * Fix json bytes encoding (@phoban01) - * Add Helm chart an option to specify AWS Security Group policy (@nalum) - * Move plan revision from labels to annotations (@nalum) + * Add Helm chart an option to specify AWS Security Group policy (@Nalum) + * Move plan revision from labels to annotations (@Nalum) * Update images to include fix for CVE-2022-28391 (@chanwit) * Update Terraform binary to 1.1.8 (@chanwit) diff --git a/charts/tf-controller/Chart.yaml b/charts/tf-controller/Chart.yaml index a486ac65..bf3c98f5 100644 --- a/charts/tf-controller/Chart.yaml +++ b/charts/tf-controller/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: tf-controller description: The Helm chart for Weave GitOps Terraform Controller type: application -version: 0.4.2 -appVersion: "v0.11.0-rc.3" +version: 0.4.3 +appVersion: "v0.11.0" diff --git a/charts/tf-controller/values.yaml b/charts/tf-controller/values.yaml index 79d8c943..928f1edd 100644 --- a/charts/tf-controller/values.yaml +++ b/charts/tf-controller/values.yaml @@ -10,7 +10,7 @@ image: repository: ghcr.io/weaveworks/tf-controller pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "v0.11.0-rc.3" + tag: "v0.11.0" # extraEnv -- Additional container environment variables. extraEnv: {} imagePullSecrets: [] @@ -27,7 +27,7 @@ serviceAccount: runner: image: repository: ghcr.io/weaveworks/tf-runner - tag: "v0.11.0-rc.3" + tag: "v0.11.0" serviceAccount: # Specifies whether a service account should be created create: true diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 9970a1a2..40e1d1d8 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -8,4 +8,4 @@ generatorOptions: images: - name: weaveworks/tf-controller newName: ghcr.io/weaveworks/tf-controller - newTag: v0.11.0-rc.3 + newTag: v0.11.0 diff --git a/docs/release.yaml b/docs/release.yaml index e5c02144..eb97d395 100644 --- a/docs/release.yaml +++ b/docs/release.yaml @@ -20,7 +20,7 @@ spec: sourceRef: kind: HelmRepository name: tf-controller - version: '>=0.3.0' + version: '>=0.4.3' interval: 1h0s releaseName: tf-controller targetNamespace: flux-system @@ -41,7 +41,7 @@ spec: caCertValidityDuration: 24h certRotationCheckFrequency: 30m image: - tag: v0.10.1 + tag: v0.11.0 runner: image: - tag: v0.10.1 + tag: v0.11.0 diff --git a/docs/use_cases.md b/docs/use_cases.md index 852e1c66..939bdbbf 100644 --- a/docs/use_cases.md +++ b/docs/use_cases.md @@ -451,4 +451,51 @@ spec: image: registry.io/tf-runner:xyz ``` -You can use [`runner.Dockerfile`](https://github.com/weaveworks/tf-controller/blob/main/runner.Dockerfile) as a basis of customizing runner pod image. \ No newline at end of file +You can use [`runner.Dockerfile`](https://github.com/weaveworks/tf-controller/blob/main/runner.Dockerfile) as a basis of customizing runner pod image. + +## Using OCI Artifact as Source + +To use OCI artifacts as the source of TF-controller, you need Flux2 version v0.32.0 or higher. + +Assuming that you have Terraform files (your root module may contain sub-modules) under ./modules, +you can use Flux CLI to create an OCI artifact for your Terraform modules +by running the following commands: + +```bash +flux push artifact oci://ghcr.io/tf-controller/helloworld:$(git rev-parse --short HEAD) \ + --path="./modules" \ + --source="$(git config --get remote.origin.url)" \ + --revision="$(git branch --show-current)/$(git rev-parse HEAD)" + +flux tag artifact oci://ghcr.io/tf-controller/helloworld:$(git rev-parse --short HEAD) \ + --tag main +``` + +Then you define a source (`OCIRepository`), and use it as the `sourceRef` of your Terraform object. + +```yaml +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: OCIRepository +metadata: + name: helloworld-oci +spec: + interval: 1m + url: oci://ghcr.io/tf-controller/helloworld + ref: + tag: main +--- +apiVersion: infra.contrib.fluxcd.io/v1alpha1 +kind: Terraform +metadata: + name: helloworld-tf-oci +spec: + path: ./ + approvePlan: "auto" + interval: 1m + sourceRef: + kind: OCIRepository + name: helloworld-oci + writeOutputsToSecret: + name: helloworld-outputs +```