Skip to content

Commit

Permalink
Merge branch 'main' into KU-2391/charm-ownership-of-node-role-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess authored Jan 8, 2025
2 parents e957db4 + 673cdaa commit 515166a
Show file tree
Hide file tree
Showing 75 changed files with 83 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/download-charm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

name: Download Charm
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/promote-charms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,25 @@ jobs:
run: |
echo "Determines which charms were chosen from $CHOICE"
if [[ "${CHOICE}" == "all" ]]; then
echo "charms=[\"charms/worker\", \"charms/worker/k8s\"]" >> "$GITHUB_OUTPUT"
echo 'charms=[{"name": "k8s-worker", "path": "charms/worker"}, {"name": "k8s", "path": "charms/worker/k8s"}]' >> "$GITHUB_OUTPUT"
elif [[ "${CHOICE}" == "k8s" ]]; then
echo "charms=[\"charms/worker/k8s\"]" >> "$GITHUB_OUTPUT"
echo 'charms=[{"name": "k8s", "path": "charms/worker/k8s"}]' >> "$GITHUB_OUTPUT"
else
echo "charms=[\"charms/worker\"]" >> "$GITHUB_OUTPUT"
echo 'charms=[{"name": "k8s-worker", "path": "charms/worker"}]' >> "$GITHUB_OUTPUT"
fi
promote-charm:
needs: [configure-track, select-charms]
strategy:
matrix:
charm-directory: ${{ fromJson(needs.select-charms.outputs.charms) }}
charm: ${{ fromJson(needs.select-charms.outputs.charms) }}
arch:
- amd64
- arm64
uses: canonical/operator-workflows/.github/workflows/promote_charm.yaml@main
with:
base-architecture: ${{ matrix.arch }}
charm-directory: ${{ matrix.charm-directory }}
charm-directory: ${{ matrix.charm.path }}
destination-channel: ${{needs.configure-track.outputs.track}}/${{ inputs.destination-risk }}
origin-channel: ${{needs.configure-track.outputs.track}}/${{ inputs.origin-risk }}
tag-prefix: ${{ matrix.charm.name }}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/update-snap-revision.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.


Expand Down
2 changes: 1 addition & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
header:
- license:
copyright-owner: Canonical Ltd.
copyright-year: 2024
copyright-year: 2025
content: |
Copyright [year] [owner]
Licensed under the Apache2.0. See LICENSE file in charm source for details.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Canonical Ltd.
Copyright 2025 Canonical Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.
Expand Down
4 changes: 2 additions & 2 deletions charms/worker/k8s/build-snap-installation.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Create an empty tarball to be used as a placeholder for the snap installation override
echo "Creating empty tarball at $1"
touch "${1}"
touch "${1}"
2 changes: 1 addition & 1 deletion charms/worker/k8s/charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
# This file configures Charmcraft.
# See https://juju.is/docs/sdk/charmcraft-config for guidance.
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/lib/charms/k8s/v0/k8sd_api_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Module for managing k8sd API interactions.
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/lib/charms/kubernetes_libs/v0/etcd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions charms/worker/k8s/lib/charms/operator_libs_linux/v2/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 8
LIBPATCH = 9


# Regex to locate 7-bit C1 ANSI sequences
Expand Down Expand Up @@ -787,7 +787,7 @@ def _wait(self, change_id: str, timeout=300) -> JSONType:
status = response["status"]
if status == "Done":
return response.get("data")
if status == "Doing":
if status == "Doing" or status == "Do":
time.sleep(0.1)
continue
if status == "Wait":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

diff --git a/charms/worker/k8s/src/prometheus_alert_rules/kubernetesControlPlane-prometheusRule.yaml b/charms/worker/k8s/src/prometheus_alert_rules/kubernetesControlPlane-prometheusRule.yaml
Expand Down
4 changes: 2 additions & 2 deletions charms/worker/k8s/scripts/update_alert_rules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Sync AlertManager rules from an upstream repository.
Expand Down Expand Up @@ -80,7 +80,7 @@ def process_rule_file(contents, destination_file: Path, source_url: str):
]

data = [
"# Copyright 2024 Canonical Ltd.",
"# Copyright 2025 Canonical Ltd.",
"# See LICENSE file for licensing details.\n\n" f"# Automatically generated by {sys.argv}",
f"# Source: {source_url}",
yaml.safe_dump(alert_rules),
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/scripts/update_dashboards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Sync Grafana dashboards from an upstream repository.
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/charm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/cloud_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Cloud Integration for Canonical k8s Operator."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/config/extra_args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/containerd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/cos_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""COS Integration module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/events/update_status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/inspector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""A module for inspecting a Kubernetes cluster."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/kube_control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Relation kube-control module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/literals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Literals for the charm."""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Automatically generated by ['scripts/update_alert_rules.py']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Automatically generated by ['scripts/update_alert_rules.py']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Automatically generated by ['scripts/update_alert_rules.py']
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/protocols.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Protocol definitions module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/reschedule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""EventTimer for scheduling dispatch of juju event on regular intervals."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/snap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more at: https://juju.is/docs/sdk
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/token_distributor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Token Distributor module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/src/upgrade.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""A module for upgrading the k8s and k8s-worker charms."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/templates/cos_roles.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

apiVersion: rbac.authorization.k8s.io/v1
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/templates/ksm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Source: https://raw.githubusercontent.com/kubernetes/kube-state-metrics/v2.9.2/examples/standard/cluster-role-binding.yaml
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/templates/snap_installation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

amd64:
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

resource "juju_application" "k8s" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

output "app_name" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

variable "app_name" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/terraform/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

required_version = ">= 1.6"
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_cloud_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Unit tests cloud-integration module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_config_options.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_containerd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_inspector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Tests for the inspector module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_k8sd_api_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
# Ignore Pylint requiring docstring for each test function.
# pylint: disable=C0116
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_reschedule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_snap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_token_distributor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

# Learn more about testing at: https://juju.is/docs/sdk/testing
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tests/unit/test_upgrade.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Tests for the upgrade module."""
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

[tox]
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

resource "juju_application" "k8s_worker" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

output "app_name" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

variable "app_name" {
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/terraform/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

required_version = ">= 1.6"
Expand Down
2 changes: 1 addition & 1 deletion generate-src-docs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

lazydocs --no-watermark --output-path src-docs src/*
2 changes: 1 addition & 1 deletion tests/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Canonical Ltd.
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

"""Fixtures for charm tests."""
Expand Down
Loading

0 comments on commit 515166a

Please sign in to comment.