Kubernetes

Prerequisites

In the charm’s metadata.yaml:

Example metadata.yaml
resources:
  postgresql-image: (1)
    type: oci-image
    upstream-source: ghcr.io/canonical/charmed-postgresql@sha256:e53eb99abd799526bb5a5e6c58180ee47e2790c95d433a1352836aa27d0914a4 (2)

containers:
  postgresql: (3)
    resource: postgresql-image
1 The charm must have exactly 1 workload OCI image
2 The workload’s OCI image upstream-source must be pinned to a digest
3 There must be exactly 1 container that uses the OCI image resource

Create refresh_versions.toml

At the root of the charm directory (i.e. in the same directory as metadata.yaml), create the refresh_versions.toml file

refresh_versions.toml
# https://canonical-charm-refresh.readthedocs-hosted.com/latest/refresh-versions-toml/

charm_major = 1 (1)
workload = "16.8" (2)
1 Leave this as 1
2 Replace 16.8 with the upstream workload version in the OCI image pinned in metadata.yaml. The value must be a string