From b4a17c50047f42113f4b754db8e1c2d1a4caca9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20Tekin=20=C3=96z?= Date: Tue, 3 Dec 2024 21:48:38 +0300 Subject: [PATCH] Rename annotations to cluster-annotations (#198) * Rename annotations to cluster-annotations --------- Co-authored-by: Adam Dyess --- charms/worker/k8s/charmcraft.yaml | 4 ++-- charms/worker/k8s/src/charm.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charms/worker/k8s/charmcraft.yaml b/charms/worker/k8s/charmcraft.yaml index 5b3b2de9..12ee9051 100644 --- a/charms/worker/k8s/charmcraft.yaml +++ b/charms/worker/k8s/charmcraft.yaml @@ -68,11 +68,11 @@ bases: architectures: [arm64] config: options: - annotations: + cluster-annotations: type: string default: "" description: | - Annotations is a space separated list of (key/value) pairs) that can be + Space-separated list of (key/value) pairs) that can be used to add arbitrary metadata configuration to the Canonical Kubernetes cluster. For more information, see the upstream Canonical Kubernetes documentation about annotations: diff --git a/charms/worker/k8s/src/charm.py b/charms/worker/k8s/src/charm.py index 03a78b7b..3e5310be 100755 --- a/charms/worker/k8s/src/charm.py +++ b/charms/worker/k8s/src/charm.py @@ -391,7 +391,7 @@ def _configure_cos_integration(self): self.collector.request(relation) def _get_valid_annotations(self) -> Optional[dict]: - """Fetch and validate annotations from charm configuration. + """Fetch and validate cluster-annotations from charm configuration. The values are expected to be a space-separated string of key-value pairs. @@ -401,7 +401,7 @@ def _get_valid_annotations(self) -> Optional[dict]: Raises: ReconcilerError: If any annotation is invalid. """ - raw_annotations = self.config.get("annotations") + raw_annotations = self.config.get("cluster-annotations") if not raw_annotations: return None