Repository navigation
A patch release for the 0.9 line: a Configuration now writes into, and deletes, only the connection Secret it
created. No API or chart change.
What changed
Connection Secret ownership (#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.9.1 -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
GeneratingTerraformOutputswith 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 labelcommand from the
message: the Configuration then writes it, and deleting the Configuration deletes it. If the Secret belongs to
something else, pointwriteConnectionSecretToRefat a new name instead.To find unlabelled Secrets before upgrading, compare each Configuration's
spec.writeConnectionSecretToRefwith
kubectl get secret -A -l terraform.core.oam.dev/created-by=terraform-controller. -
Image tag
latest(#429): a release now moveslatestonly when it is the newestvX.Y.Z. This release does.
Image
oamdev/terraform-controller:v0.9.1@sha256:db37e4b6d560b8b241702c6e9878be9a944767601b77b042d55fe901ecf6af51 (linux/amd64, linux/arm64), also on
ghcr.io/kubevela/oamdev/terraform-controller. Chart 0.9.1 in https://kubevela.github.io/charts.
What's Changed
- [Backport release-0.9] ci: tag latest only for the newest release by @jerrinfrancis in #429
- [Backport release-0.9] fix: delete and overwrite only the connection Secret a Configuration created by @briankane in #433
The changes landed on master in #428 and #431.
Full Changelog: v0.9.0...v0.9.1