Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd.
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
# Adapted from: https://github.com/canonical/postgresql-operator/blob/main/.github/workflows/ci.yaml
name: Build charm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd.
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
# Adapted from: https://github.com/canonical/postgresql-operator/blob/main/.github/workflows/ci.yaml
name: Lint charm
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v5
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~1.10"
terraform_version: "~1.12"

- uses: terraform-linters/setup-tflint@v4
- run: make terraform-check-all
19 changes: 19 additions & 0 deletions .github/workflows/test_terraform_modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.

name: Terraform modules tests

on:
workflow_dispatch:
pull_request:
paths:
- "terraform/**"

jobs:
terraform-tests:
uses: canonical/operator-workflows/.github/workflows/terraform_modules_test.yaml@main
secrets: inherit
with:
lxd-controller: true
self-hosted-runner: true
terraform-directories: '["terraform/charm", "terraform/product/modules/landscape-scalable"]'
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd.
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
# Adapted from: https://github.com/canonical/postgresql-operator/blob/main/.github/workflows/ci.yaml
name: Unit test charm
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~1.10"
terraform_version: "~1.12"

- name: Run terraform tests
run: make terraform-test-all
2 changes: 1 addition & 1 deletion actions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd
# Copyright 2026 Canonical Ltd
# See LICENSE file for licensing details.

hash-id-databases:
Expand Down
2 changes: 1 addition & 1 deletion copyright
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: http://dep.debian.net/deps/dep5/

Files: *
Copyright: Copyright 2025, Canonical Ltd., All Rights Reserved.
Copyright: Copyright 2026, Canonical Ltd., All Rights Reserved.
License: GPL-2
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion lib/charms/grafana_agent/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd
# Copyright 2026 Canonical Ltd
# See LICENSE file for licensing details.

# For a complete list of supported options, see:
Expand Down
79 changes: 79 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"customDatasources": {
"charmhub": {
"defaultRegistryUrlTemplate": "https://api.charmhub.io/v2/charms/info/{{packageName}}?fields=channel-map",
"format": "json",
"transformTemplates": [
"{\"releases\": [{\"version\": $string($$.(`channel-map`[channel.risk = 'edge' and channel.track = 'latest' and channel.base.architecture = 'amd64' and channel.base.channel = '24.04'].revision.revision))}]}"
]
}
},
"customManagers": [
{
"customType": "regex",
"datasourceTemplate": "docker",
"description": "Update base image references",
"managerFilePatterns": [
"/(^|/)rockcraft.yaml$/"
],
"matchStrings": [
"# renovate: build-base:\\s+(?<depName>[^:]*):(?<currentValue>[^\\s@]*)(@(?<currentDigest>sha256:[0-9a-f]*))?",
"# renovate: base:\\s+(?<depName>[^:]*):(?<currentValue>[^\\s@]*)(@(?<currentDigest>sha256:[0-9a-f]*))?"
],
"matchStringsStrategy": "any",
"versioningTemplate": "ubuntu"
},
{
"customType": "regex",
"datasourceTemplate": "custom.charmhub",
"fileMatch": [
"\\.tftest\\.hcl$",
"\\.tf$"
],
"matchStrings": [
"# renovate: depName=\"(?<packageName>[^\"]+)\"\\s*\\n\\s*(?<fieldName>[a-zA-Z0-9_]+)\\s*=\\s*(?<currentValue>\\d+)"
],
"versioningTemplate": "semver-coerced"
}
],
"extends": [
"config:recommended",
"group:allNonMajor"
],
"ignorePaths": [],
"packageRules": [
{
"enabled": true,
"matchDatasources": [
"docker"
],
"pinDigests": true
},
{
"automerge": true,
"enabled": true,
"matchDatasources": [
"custom.charmhub"
]
},
{
"enabled": false,
"matchFileNames": [
"rockcraft.yaml"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
]
}
],
"schedule": [
"* * * * 0,6"
],
"vulnerabilityAlerts": {
"enabled": true
}
}
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2025 Canonical Ltd
# Copyright 2026 Canonical Ltd
# See LICENSE file for licensing details.
#
# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion src/settings_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Canonical Ltd
# Copyright 2026 Canonical Ltd

"""
Functions for manipulating Landscape Server service settings in the
Expand Down
5 changes: 5 additions & 0 deletions terraform/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2026 Canonical Ltd.

rule "terraform_required_version" {
enabled = true
}
2 changes: 1 addition & 1 deletion terraform/charm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

test-charm-module:
terraform init -backend=false && \
terraform test
terraform test -filter=tests/outputs.tftest.hcl

fmt-check:
terraform init -backend=false && \
Expand Down
2 changes: 1 addition & 1 deletion terraform/charm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ make fix-charm-module

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.12 |
| <a name="requirement_juju"></a> [juju](#requirement\_juju) | ~> 1.0 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion terraform/charm/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2025 Canonical Ltd.
# © 2026 Canonical Ltd.

resource "juju_application" "landscape_server" {
name = var.app_name
Expand Down
21 changes: 21 additions & 0 deletions terraform/charm/tests/main.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# © 2026 Canonical Ltd.

run "setup_tests" {
module {
source = "./tests/setup"
}
}

run "basic_deploy" {
variables {
model_uuid = run.setup_tests.model_uuid
channel = "26.04/edge"
# renovate: depName="landscape-server"
revision = 355
}

assert {
condition = output.app_name == "landscape-server"
error_message = "landscape-server app_name did not match expected"
}
}
2 changes: 1 addition & 1 deletion terraform/charm/tests/outputs.tftest.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2025 Canonical Ltd.
# © 2026 Canonical Ltd.

mock_provider "juju" {}

Expand Down
21 changes: 21 additions & 0 deletions terraform/charm/tests/setup/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# © 2026 Canonical Ltd.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
version = "~> 1.0"
source = "juju/juju"
}
}
}

provider "juju" {}

resource "juju_model" "test_model" {
name = "tf-testing-${formatdate("YYYYMMDDhhmmss", timestamp())}"
}

output "model_uuid" {
value = juju_model.test_model.uuid
}
2 changes: 1 addition & 1 deletion terraform/charm/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2025 Canonical Ltd.
# © 2026 Canonical Ltd.

variable "app_name" {
description = "Name of the application in the Juju model."
Expand Down
4 changes: 2 additions & 2 deletions terraform/charm/versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# © 2025 Canonical Ltd.
# © 2026 Canonical Ltd.

terraform {
required_version = ">= 1.10"
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
Expand Down
5 changes: 4 additions & 1 deletion terraform/product/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ test-product-modules:
for m in $(MODULE_PATHS); do \
cd $$m && \
terraform init -backend=false && \
terraform test; \
terraform test \
-filter=tests/defaults.tftest.hcl \
-filter=tests/outputs.tftest.hcl \
-filter=tests/integrations.tftest.hcl; \
done
Loading
Loading