From 6f8fbe6ef3a6e3dc33c37ffdfdc70d05a7adab36 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Sun, 3 Aug 2025 09:19:37 +0000 Subject: [PATCH] Updates charm to a modern version This also updates the resulting base image OS (previously ubuntu 20.04), which was no longer supported. --- charmcraft.yaml | 40 ++++++++++++++++++++++++++++++++-------- metadata.yaml | 25 ------------------------- requirements.txt | 1 + 3 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 metadata.yaml diff --git a/charmcraft.yaml b/charmcraft.yaml index 048d454..53b1683 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,10 +1,34 @@ # Learn more about charmcraft.yaml configuration at: # https://juju.is/docs/sdk/charmcraft-config -type: "charm" -bases: - - build-on: - - name: "ubuntu" - channel: "20.04" - run-on: - - name: "ubuntu" - channel: "20.04" +type: charm +name: postgresql-data-k8s +title: PostgreSQL Data Injector Charm + +summary: | + PostgreSQL Database Injector Charm + +description: | + This charm can be related to a postgresql-k8s charm (using the db-admin relation), and + this charm will execute the SQL tar dump given as a resource. + + If the refresh-period (minutes) is non-zero, this charm will reexecute the SQL tar dump + after that number of minutes have passed since the last update. + + This charm can be configured with the db-user config option, which will be the new + owner of the newly created data (otherwise, consumers of that database will encounter + Permission Denied errors). + +base: ubuntu@24.04 +platforms: + amd64: + +requires: + db-admin: + interface: pgsql + limit: 1 + scope: global + +parts: + charm: + plugin: charm + source: . diff --git a/metadata.yaml b/metadata.yaml deleted file mode 100644 index a11f699..0000000 --- a/metadata.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2022 Canonical Ltd. -# See LICENSE file for licensing details. - -name: postgresql-data-k8s -display-name: PostgreSQL Data Injector Charm - -summary: | - PostgreSQL Database Injector Charm - -description: | - This charm can be related to a postgresql-k8s charm (using the db-admin relation), and - this charm will execute the SQL tar dump given as a resource. - - If the refresh-period (minutes) is non-zero, this charm will reexecute the SQL tar dump - after that number of minutes have passed since the last update. - - This charm can be configured with the db-user config option, which will be the new - owner of the newly created data (otherwise, consumers of that database will encounter - Permission Denied errors). - -requires: - db-admin: - interface: pgsql - limit: 1 - scope: global diff --git a/requirements.txt b/requirements.txt index cf62bc0..6fc2074 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ ops >= 1.2.0 ops-lib-pgsql pgconnstr +requests