diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 1d3dd7a8..dad1e523 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -22,10 +22,12 @@ jobs: flavors: - name: sonic - name: cumulus + - name: gardener steps: - name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 run: | + [ -d "${GITHUB_WORKSPACE}/mini-lab/.ansible/tmp/extension-provider-metal/.git" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE}/mini-lab/.ansible/tmp/extension-provider-metal/.git [ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE} - name: Setup Containerlab @@ -34,7 +36,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # we can remove desired version again after this fix was released: https://github.com/srl-labs/containerlab/pull/2000 - DESIRED_VERSION: v0.56.0 + # DESIRED_VERSION: - name: Checkout uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index 92d25fef..d82ff67d 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ prep: .PHONY: mini-lab mini-lab: - make -C $(MINI_LAB_PATH) + cd $(MINI_LAB_PATH) && make .PHONY: wait-for-images wait-for-images: diff --git a/release.yaml b/release.yaml index 5b006d76..51924caf 100644 --- a/release.yaml +++ b/release.yaml @@ -7,7 +7,7 @@ ansible-roles: version: v0.2.9 metal-roles: repository: https://github.com/metal-stack/metal-roles - version: v0.14.7 + version: v0.14.8 binaries: metal-stack: kernel: @@ -70,7 +70,7 @@ docker-images: gardener-extension-backup-s3: name: ghcr.io/metal-stack/gardener-extension-backup-s3 repository: https://github.com/metal-stack/gardener-extension-backup-s3 - tag: v0.7.0 + tag: v0.7.1 gardener-extension-csi-driver-lvm: name: ghcr.io/metal-stack/gardener-extension-csi-driver-lvm repository: https://github.com/metal-stack/gardener-extension-csi-driver-lvm @@ -78,7 +78,7 @@ docker-images: gardener-extension-dns-powerdns: name: ghcr.io/metal-stack/gardener-extension-dns-powerdns repository: https://github.com/metal-stack/gardener-extension-dns-powerdns - tag: v0.7.0 + tag: v0.7.1 gardener-extension-provider-metal: name: ghcr.io/metal-stack/gardener-extension-provider-metal repository: https://github.com/metal-stack/gardener-extension-provider-metal @@ -120,7 +120,7 @@ docker-images: duros-controller: name: ghcr.io/metal-stack/duros-controller repository: https://github.com/metal-stack/duros-controller - tag: v0.11.1 + tag: v0.11.2 metal-ccm: name: ghcr.io/metal-stack/metal-ccm repository: https://github.com/metal-stack/metal-ccm @@ -195,19 +195,19 @@ docker-images: tag: v1.4.0 admission-controller: name: europe-docker.pkg.dev/gardener-project/releases/gardener/admission-controller - tag: v1.100.2 + tag: v1.101.3 api-server: name: europe-docker.pkg.dev/gardener-project/releases/gardener/apiserver - tag: v1.100.2 + tag: v1.101.3 controller-manager: name: europe-docker.pkg.dev/gardener-project/releases/gardener/controller-manager - tag: v1.100.2 + tag: v1.101.3 extension-provider-gcp: name: europe-docker.pkg.dev/gardener-project/releases/gardener/extensions/provider-gcp tag: v1.37.2 gardenlet: name: europe-docker.pkg.dev/gardener-project/releases/gardener/gardenlet - tag: v1.100.2 + tag: v1.101.3 metrics-exporter: name: europe-docker.pkg.dev/gardener-project/releases/gardener/metrics-exporter tag: 0.30.0 @@ -219,10 +219,10 @@ docker-images: tag: v1.36.0 operator: name: europe-docker.pkg.dev/gardener-project/releases/gardener/operator - tag: v1.100.2 + tag: v1.101.3 scheduler: name: europe-docker.pkg.dev/gardener-project/releases/gardener/scheduler - tag: v1.100.2 + tag: v1.101.3 shoot-cert-service: name: europe-docker.pkg.dev/gardener-project/releases/gardener/extensions/shoot-cert-service tag: v1.44.2 @@ -277,7 +277,7 @@ projects: metal-stack: mini-lab: repository: https://github.com/metal-stack/mini-lab - version: v0.4.2 + version: v0.4.3 repositories: third-party: gardener: @@ -285,5 +285,5 @@ repositories: ref: v0.15.4 url: https://github.com/gardener/etcd-backup-restore.git gardener: - ref: v1.100.2 + ref: v1.101.3 url: https://github.com/gardener/gardener.git diff --git a/test/integration/deployment/integration.sh b/test/integration/deployment/integration.sh index eb48b902..adf465c6 100755 --- a/test/integration/deployment/integration.sh +++ b/test/integration/deployment/integration.sh @@ -33,4 +33,4 @@ pip install --root-user-action=ignore --upgrade pip \ # if you want to develop tests from within here, comment in the following line: # bash -pytest --junitxml=/output/results_$(date "+%Y.%m.%d-%H.%M.%S").xml +pytest -o cache_dir=/tmp/.pytest-cache --junitxml=/output/results_$(date "+%Y.%m.%d-%H.%M.%S").xml diff --git a/test/integration/deployment/test/deployment_test.py b/test/integration/deployment/test/deployment_test.py index e042f4f7..c58a79c2 100644 --- a/test/integration/deployment/test/deployment_test.py +++ b/test/integration/deployment/test/deployment_test.py @@ -6,8 +6,9 @@ from metal_python.driver import Driver import pytest import testinfra - +import yaml import common +import base64 class MetalControlPlaneDeployment(unittest.TestCase): @@ -97,3 +98,51 @@ def test_dhcpd_service(self): self.service_enabled_and_running(self.hosts[0], "isc-dhcp-server") else: self.service_enabled_and_running(self.hosts[0], "dhcpd") + + +def garden_namespace_exists(): + config.load_kube_config() + v1 = client.CoreV1Api() + try: + res = v1.read_namespace("garden") + return True + except client.exceptions.ApiException: + return False + + +@unittest.skipUnless(garden_namespace_exists(), "test only if gardener flavor was used") +class GardenerControlPlaneDeployment(unittest.TestCase): + def __init__(self, *args, **kwargs): + super(GardenerControlPlaneDeployment, self).__init__(*args, **kwargs) + config.load_kube_config() + self.maxDiff = None + + @pytest.mark.flaky(reruns=36, reruns_delay=10) + def test_deployment(self): + v1 = client.AppsV1Api() + for ns in ["garden", "istio-ingress", "istio-system"]: + res = v1.list_namespaced_deployment(ns) + for i in res.items: + self.assertIsNone(i.status.unavailable_replicas, f"deployment {i.metadata.name} in namespace {ns} has unavailable replicas") + + @pytest.mark.flaky(reruns=36, reruns_delay=10) + def test_stateful_sets(self): + v1 = client.AppsV1Api() + for ns in ["garden", "istio-ingress", "istio-system"]: + res = v1.list_namespaced_stateful_set(ns) + for i in res.items: + self.assertEqual(i.status.current_replicas, i.status.replicas, f"stateful set {i.metadata.name} in namespace {ns} has unready replicas") + + @pytest.mark.flaky(reruns=36, reruns_delay=10) + def test_seed_ready(self): + v1 = client.CoreV1Api() + secret = v1.read_namespaced_secret("garden-kubeconfig-for-admin", "garden") + garden_client = config.new_client_from_config_dict(yaml.safe_load(base64.b64decode(secret.data["kubeconfig"]))) + + custom = client.CustomObjectsApi(api_client=garden_client) + + seeds = custom.list_cluster_custom_object("core.gardener.cloud", "v1beta1", "seeds") + + self.assertTrue(len(seeds["items"]) == 1, "no seed object found") + self.assertEqual(seeds["items"][0]["status"]["lastOperation"]["state"], "Succeeded") + self.assertEqual(seeds["items"][0]["status"]["lastOperation"]["progress"], 100)