From e3dd80a61656b90b1e2e03d63f000bfdd6a54742 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Fri, 24 Apr 2026 17:25:17 -0400 Subject: [PATCH 1/7] chore --- terraform/cos-lite/applications.tf | 2 +- terraform/cos-lite/upgrades.tf | 28 ++++++++++++++++++++++++++++ terraform/cos-lite/variables.tf | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 terraform/cos-lite/upgrades.tf diff --git a/terraform/cos-lite/applications.tf b/terraform/cos-lite/applications.tf index eeff262a..3d171989 100644 --- a/terraform/cos-lite/applications.tf +++ b/terraform/cos-lite/applications.tf @@ -23,7 +23,7 @@ module "catalogue" { } module "grafana" { - source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=track/2" + source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=test/lifecycle-input-track-2" app_name = var.grafana.app_name channel = var.channel config = var.grafana.config diff --git a/terraform/cos-lite/upgrades.tf b/terraform/cos-lite/upgrades.tf new file mode 100644 index 00000000..4a7e719c --- /dev/null +++ b/terraform/cos-lite/upgrades.tf @@ -0,0 +1,28 @@ +# -------------- # Application replace triggers -------------- # + +# Grafana removed the litestream-image resource +# The litestream-image resource was removed and given a Juju bug, we need to add a lifecycle to +# trigger application replacement, otherwise the upgrade will fail +# https://github.com/juju/juju/issues/21648 +# https://github.com/juju/juju/issues/22071 +resource "terraform_data" "grafana_litestream_resource" { + triggers_replace = contains(keys(data.juju_charm.grafana_info.resources), "litestream-image") +} + +# -------------- # Integration replace triggers -------------- # + +# Grafana ingress interface changed +# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need a +# lifecycle to trigger integration replacement, otherwise the upgrade will fail +# https://github.com/canonical/observability-stack/issues/165 +resource "terraform_data" "grafana_ingress_interface" { + triggers_replace = data.juju_charm.grafana_info.requires["ingress"] +} + +# -------------- # CharmHub API -------------- # + +data "juju_charm" "grafana_info" { + charm = "grafana-k8s" + channel = local.channels.grafana + base = var.base +} diff --git a/terraform/cos-lite/variables.tf b/terraform/cos-lite/variables.tf index 7e146fcf..a46d113d 100644 --- a/terraform/cos-lite/variables.tf +++ b/terraform/cos-lite/variables.tf @@ -10,6 +10,12 @@ locals { tls_termination = var.external_certificates_offer_url != null ? true : false } +variable "base" { + description = "The operating system on which to deploy. E.g. ubuntu@24.04. Check Charmhub for per-charm base support." + default = "ubuntu@24.04" + type = string +} + variable "channel" { description = "Channel that the applications are (unless overwritten by individual channels) deployed from" type = string From 6faaf4185218b31a818fdb6b656ae7c889c82755 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Fri, 24 Apr 2026 17:27:12 -0400 Subject: [PATCH 2/7] chore --- terraform/cos-lite/upgrades.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/cos-lite/upgrades.tf b/terraform/cos-lite/upgrades.tf index 4a7e719c..b800c93d 100644 --- a/terraform/cos-lite/upgrades.tf +++ b/terraform/cos-lite/upgrades.tf @@ -23,6 +23,6 @@ resource "terraform_data" "grafana_ingress_interface" { data "juju_charm" "grafana_info" { charm = "grafana-k8s" - channel = local.channels.grafana + channel = var.channel base = var.base } From bd766fdd052a125e04e0494affd2273e82a3a864 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Sat, 25 Apr 2026 17:31:01 -0400 Subject: [PATCH 3/7] chore --- terraform/cos-lite/upgrades.tf | 2 +- terraform/cos-lite/variables.tf | 6 ------ terraform/cos/applications.tf | 2 +- terraform/cos/upgrades.tf | 28 ++++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 terraform/cos/upgrades.tf diff --git a/terraform/cos-lite/upgrades.tf b/terraform/cos-lite/upgrades.tf index b800c93d..a14d5408 100644 --- a/terraform/cos-lite/upgrades.tf +++ b/terraform/cos-lite/upgrades.tf @@ -24,5 +24,5 @@ resource "terraform_data" "grafana_ingress_interface" { data "juju_charm" "grafana_info" { charm = "grafana-k8s" channel = var.channel - base = var.base + base = "ubuntu@24.04" } diff --git a/terraform/cos-lite/variables.tf b/terraform/cos-lite/variables.tf index a46d113d..7e146fcf 100644 --- a/terraform/cos-lite/variables.tf +++ b/terraform/cos-lite/variables.tf @@ -10,12 +10,6 @@ locals { tls_termination = var.external_certificates_offer_url != null ? true : false } -variable "base" { - description = "The operating system on which to deploy. E.g. ubuntu@24.04. Check Charmhub for per-charm base support." - default = "ubuntu@24.04" - type = string -} - variable "channel" { description = "Channel that the applications are (unless overwritten by individual channels) deployed from" type = string diff --git a/terraform/cos/applications.tf b/terraform/cos/applications.tf index 3bc0a1d1..adb786ed 100644 --- a/terraform/cos/applications.tf +++ b/terraform/cos/applications.tf @@ -23,7 +23,7 @@ module "catalogue" { } module "grafana" { - source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=track/2" + source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=test/lifecycle-input-track-2" app_name = var.grafana.app_name channel = var.channel config = var.grafana.config diff --git a/terraform/cos/upgrades.tf b/terraform/cos/upgrades.tf new file mode 100644 index 00000000..a14d5408 --- /dev/null +++ b/terraform/cos/upgrades.tf @@ -0,0 +1,28 @@ +# -------------- # Application replace triggers -------------- # + +# Grafana removed the litestream-image resource +# The litestream-image resource was removed and given a Juju bug, we need to add a lifecycle to +# trigger application replacement, otherwise the upgrade will fail +# https://github.com/juju/juju/issues/21648 +# https://github.com/juju/juju/issues/22071 +resource "terraform_data" "grafana_litestream_resource" { + triggers_replace = contains(keys(data.juju_charm.grafana_info.resources), "litestream-image") +} + +# -------------- # Integration replace triggers -------------- # + +# Grafana ingress interface changed +# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need a +# lifecycle to trigger integration replacement, otherwise the upgrade will fail +# https://github.com/canonical/observability-stack/issues/165 +resource "terraform_data" "grafana_ingress_interface" { + triggers_replace = data.juju_charm.grafana_info.requires["ingress"] +} + +# -------------- # CharmHub API -------------- # + +data "juju_charm" "grafana_info" { + charm = "grafana-k8s" + channel = var.channel + base = "ubuntu@24.04" +} From 52bf6148efe1c5a8d28db2309225b2c6834eb881 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Mon, 27 Apr 2026 11:59:52 -0400 Subject: [PATCH 4/7] chore --- terraform/cos-lite/upgrades.tf | 2 +- terraform/cos/upgrades.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/cos-lite/upgrades.tf b/terraform/cos-lite/upgrades.tf index a14d5408..d0f4611e 100644 --- a/terraform/cos-lite/upgrades.tf +++ b/terraform/cos-lite/upgrades.tf @@ -16,7 +16,7 @@ resource "terraform_data" "grafana_litestream_resource" { # lifecycle to trigger integration replacement, otherwise the upgrade will fail # https://github.com/canonical/observability-stack/issues/165 resource "terraform_data" "grafana_ingress_interface" { - triggers_replace = data.juju_charm.grafana_info.requires["ingress"] + triggers_replace = lookup(data.juju_charm.grafana_info.requires, "ingress", "") } # -------------- # CharmHub API -------------- # diff --git a/terraform/cos/upgrades.tf b/terraform/cos/upgrades.tf index a14d5408..d0f4611e 100644 --- a/terraform/cos/upgrades.tf +++ b/terraform/cos/upgrades.tf @@ -16,7 +16,7 @@ resource "terraform_data" "grafana_litestream_resource" { # lifecycle to trigger integration replacement, otherwise the upgrade will fail # https://github.com/canonical/observability-stack/issues/165 resource "terraform_data" "grafana_ingress_interface" { - triggers_replace = data.juju_charm.grafana_info.requires["ingress"] + triggers_replace = lookup(data.juju_charm.grafana_info.requires, "ingress", "") } # -------------- # CharmHub API -------------- # From 147b1860c8015fd9ec2beabd5410d9e085828c9a Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Mon, 27 Apr 2026 16:48:10 -0400 Subject: [PATCH 5/7] chore --- terraform/cos-lite/upgrades.tf | 17 ++++++++--------- terraform/cos/upgrades.tf | 17 ++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/terraform/cos-lite/upgrades.tf b/terraform/cos-lite/upgrades.tf index d0f4611e..89925572 100644 --- a/terraform/cos-lite/upgrades.tf +++ b/terraform/cos-lite/upgrades.tf @@ -1,19 +1,18 @@ -# -------------- # Application replace triggers -------------- # +# -------------- # Replace triggers -------------- # -# Grafana removed the litestream-image resource -# The litestream-image resource was removed and given a Juju bug, we need to add a lifecycle to -# trigger application replacement, otherwise the upgrade will fail +# -- Grafana -- # + +# [application] Removed the litestream-image resource +# Given a Juju bug, we need to trigger application replacement, otherwise the upgrade will fail # https://github.com/juju/juju/issues/21648 # https://github.com/juju/juju/issues/22071 resource "terraform_data" "grafana_litestream_resource" { triggers_replace = contains(keys(data.juju_charm.grafana_info.resources), "litestream-image") } -# -------------- # Integration replace triggers -------------- # - -# Grafana ingress interface changed -# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need a -# lifecycle to trigger integration replacement, otherwise the upgrade will fail +# [integration] Ingress interface changed +# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need to +# trigger integration replacement, otherwise the upgrade will fail # https://github.com/canonical/observability-stack/issues/165 resource "terraform_data" "grafana_ingress_interface" { triggers_replace = lookup(data.juju_charm.grafana_info.requires, "ingress", "") diff --git a/terraform/cos/upgrades.tf b/terraform/cos/upgrades.tf index d0f4611e..89925572 100644 --- a/terraform/cos/upgrades.tf +++ b/terraform/cos/upgrades.tf @@ -1,19 +1,18 @@ -# -------------- # Application replace triggers -------------- # +# -------------- # Replace triggers -------------- # -# Grafana removed the litestream-image resource -# The litestream-image resource was removed and given a Juju bug, we need to add a lifecycle to -# trigger application replacement, otherwise the upgrade will fail +# -- Grafana -- # + +# [application] Removed the litestream-image resource +# Given a Juju bug, we need to trigger application replacement, otherwise the upgrade will fail # https://github.com/juju/juju/issues/21648 # https://github.com/juju/juju/issues/22071 resource "terraform_data" "grafana_litestream_resource" { triggers_replace = contains(keys(data.juju_charm.grafana_info.resources), "litestream-image") } -# -------------- # Integration replace triggers -------------- # - -# Grafana ingress interface changed -# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need a -# lifecycle to trigger integration replacement, otherwise the upgrade will fail +# [integration] Ingress interface changed +# The ingress endpoint interface changes from traefik_route to ingress_per_app so we need to +# trigger integration replacement, otherwise the upgrade will fail # https://github.com/canonical/observability-stack/issues/165 resource "terraform_data" "grafana_ingress_interface" { triggers_replace = lookup(data.juju_charm.grafana_info.requires, "ingress", "") From 6bffab40b363ac9f6a4cc24108f1ff8c4685c4fb Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Mon, 27 Apr 2026 17:02:47 -0400 Subject: [PATCH 6/7] chore --- terraform/cos-lite/applications.tf | 2 +- terraform/cos/applications.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/cos-lite/applications.tf b/terraform/cos-lite/applications.tf index 3d171989..eeff262a 100644 --- a/terraform/cos-lite/applications.tf +++ b/terraform/cos-lite/applications.tf @@ -23,7 +23,7 @@ module "catalogue" { } module "grafana" { - source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=test/lifecycle-input-track-2" + source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=track/2" app_name = var.grafana.app_name channel = var.channel config = var.grafana.config diff --git a/terraform/cos/applications.tf b/terraform/cos/applications.tf index adb786ed..3bc0a1d1 100644 --- a/terraform/cos/applications.tf +++ b/terraform/cos/applications.tf @@ -23,7 +23,7 @@ module "catalogue" { } module "grafana" { - source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=test/lifecycle-input-track-2" + source = "git::https://github.com/canonical/grafana-k8s-operator//terraform?ref=track/2" app_name = var.grafana.app_name channel = var.channel config = var.grafana.config From 2162201fd5f8c6ccfb1f406764281ac18bed29f5 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Mon, 27 Apr 2026 17:04:31 -0400 Subject: [PATCH 7/7] chore --- terraform/cos-lite/README.md | 1 + terraform/cos/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/terraform/cos-lite/README.md b/terraform/cos-lite/README.md index 83786760..1d6fef7f 100644 --- a/terraform/cos-lite/README.md +++ b/terraform/cos-lite/README.md @@ -8,6 +8,7 @@ This is a Terraform module facilitating the deployment of the COS Lite solution, | Name | Version | |------|---------| | [juju](#provider\_juju) | ~> 1.0 | +| [terraform](#provider\_terraform) | n/a | ## Modules diff --git a/terraform/cos/README.md b/terraform/cos/README.md index 07d1cedd..c513b555 100644 --- a/terraform/cos/README.md +++ b/terraform/cos/README.md @@ -11,6 +11,7 @@ This is a Terraform module facilitating the deployment of the COS solution, usin | Name | Version | |------|---------| | [juju](#provider\_juju) | ~> 1.0 | +| [terraform](#provider\_terraform) | n/a | ## Modules