Skip to content

v0.8.2

Choose a tag to compare

@briankane briankane released this 19 Nov 09:06
· 73 commits to master since this release
1b717c6

A patch release for the 0.8 line: a Configuration now writes into, and deletes, only the connection Secret it
created.
No API or chart change (the controller is still built with Go 1.17).

What changed

Connection Secret ownership (#432, the backport of #431). Before, a Configuration's writeConnectionSecretToRef
could name any Secret: writing the outputs overwrote it, and deleting the Configuration deleted it, even when the Secret
belonged to another Configuration or to an application.

Now the controller writes into and deletes only a connection Secret labelled as that Configuration's own:

terraform.core.oam.dev/created-by: terraform-controller
terraform.core.oam.dev/owned-by: <configuration name>
terraform.core.oam.dev/owned-namespace: <configuration namespace>
  • A Secret it creates gets these labels, as before; it is updated and deleted with its Configuration.
  • Another Configuration's Secret is refused and left unchanged; deleting the Configuration leaves it in place.
  • A Secret without the labels (made by hand, by another tool, or by a controller older than 0.7.10) is refused
    and left unchanged; deleting the Configuration leaves it in place.
  • If the connection Secret can't be read when a Configuration is deleted, the destroy Job, the Terraform state and the
    finalizer stay until it can, instead of the Secret being skipped.

Upgrade notes

helm repo update kubevela
helm upgrade terraform-controller kubevela/terraform-controller --version 0.8.2 -n <namespace>
  • Secrets created by the controller since 0.7.10 (2022) carry the labels: Configurations that write them keep
    working, with nothing to do.

  • A refused Configuration has already run its apply: the cloud resources exist, and the Configuration waits in
    GeneratingTerraformOutputs with one of these messages:

    configuration(namespace: <ns> ; name: <name>) cannot update secret(namespace: <ns> ; name: <secret>) whose owner is configuration(namespace: <ns> ; name: <owner>)
    

    Two Configurations write the same Secret: give one of them another writeConnectionSecretToRef.

    configuration(namespace: <ns> ; name: <name>) cannot update secret(namespace: <ns> ; name: <secret>) which no configuration owns; if this configuration wrote it before the ownership labels existed, label it to adopt it: kubectl label secret --overwrite -n <ns> <secret> terraform.core.oam.dev/created-by=terraform-controller terraform.core.oam.dev/owned-by=<name> terraform.core.oam.dev/owned-namespace=<ns>
    

    If the Secret is this Configuration's (written by an old controller), run the kubectl label command from the
    message: the Configuration then writes it, and deleting the Configuration deletes it. If the Secret belongs to
    something else, point writeConnectionSecretToRef at a new name instead.

    To find unlabelled Secrets before upgrading, compare each Configuration's spec.writeConnectionSecretToRef with
    kubectl get secret -A -l terraform.core.oam.dev/created-by=terraform-controller.

  • Image tag latest (#430): a release now moves latest only when it is the newest vX.Y.Z; this one doesn't
    (latest stays on the 0.9 line).

  • Moving to the 0.9 line: v0.9.1 has the same fix.

Image

oamdev/terraform-controller:v0.8.2@sha256:a3341e8b831cfb79608f4bbc8800909b7ef395cd3e476288aadd7544cb625549 (linux/amd64, linux/arm64), also on
ghcr.io/kubevela/oamdev/terraform-controller. Chart 0.8.2 in https://kubevela.github.io/charts.

What's Changed

  • [Backport release-0.8] ci: tag latest only for the newest release by @jerrinfrancis in #430
  • [Backport release-0.8] fix: delete and overwrite only the connection Secret a Configuration created by @briankane in #432

The changes landed on master in #428 and #431.

Full Changelog: v0.8.1...v0.8.2