diff --git a/.github/workflows/test-upgrade.yml b/.github/workflows/test-upgrade.yml index 0d6694c3bd..38543b1040 100644 --- a/.github/workflows/test-upgrade.yml +++ b/.github/workflows/test-upgrade.yml @@ -68,7 +68,6 @@ jobs: sudo env "PATH=$PATH" CI=true APPLIANCE_MODE=true make test-e2e ARCH=amd64 sudo chown $USER /tmp/zarf-*.log - - name: Run the upgrade tests # NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of zarf installed # in a previous step. This test run will the current release to create a K3s cluster. diff --git a/src/pkg/k8s/pods.go b/src/pkg/k8s/pods.go index 361c69cfe5..322b818406 100644 --- a/src/pkg/k8s/pods.go +++ b/src/pkg/k8s/pods.go @@ -142,7 +142,7 @@ func (k *K8s) WaitForPodsAndContainers(target PodLookup, include PodFilter) []st } - k.Log("Ready pods", readyPods) + k.Log("Ready pods %#v", readyPods) if len(readyPods) > 0 { return readyPods } diff --git a/src/test/upgrade/files/data-injection-values.yaml b/src/test/upgrade/files/data-injection-values.yaml new file mode 100644 index 0000000000..6a53615ba9 --- /dev/null +++ b/src/test/upgrade/files/data-injection-values.yaml @@ -0,0 +1,2 @@ +podAnnotations: + zarf.dev/dataInjections: ###ZARF_DATA_INJECTION_MARKER### diff --git a/src/test/upgrade/files/service.yaml b/src/test/upgrade/files/service.yaml new file mode 100644 index 0000000000..4547b3dd48 --- /dev/null +++ b/src/test/upgrade/files/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: podinfo + annotations: + zarf.dev/connect-description: Access Podinfo + labels: + # Enables "zarf connect podinfo" + zarf.dev/connect-name: podinfo +spec: + selector: + app.kubernetes.io/name: podinfo-upgrade + ports: + - name: http + port: 9898 + protocol: TCP + targetPort: 9898 diff --git a/src/test/upgrade/zarf.yaml b/src/test/upgrade/zarf.yaml index 3092d27a28..a38994ad33 100644 --- a/src/test/upgrade/zarf.yaml +++ b/src/test/upgrade/zarf.yaml @@ -6,18 +6,34 @@ metadata: components: - name: test-upgrade-package - description: A semi-contrived example that deploys podinfo and lets us upgrade it a few times. + description: A semi-contrived example that deploys podinfo using many Zarf primitives and lets us upgrade it a few times. required: true charts: - name: podinfo-upgrade version: "###ZARF_PKG_VAR_PODINFO_VERSION###" namespace: podinfo-upgrade url: oci://ghcr.io/stefanprodan/charts/podinfo + valuesFiles: + - files/data-injection-values.yaml + manifests: + - name: connect-service + namespace: podinfo-upgrade + files: + - files/service.yaml images: - "ghcr.io/stefanprodan/podinfo:###ZARF_PKG_VAR_PODINFO_VERSION###" + repos: + - https://github.com/kelseyhightower/nocode.git files: - source: https://raw.githubusercontent.com/stefanprodan/podinfo/###ZARF_PKG_VAR_PODINFO_VERSION###/.cosign/cosign.pub target: podinfo-cosign.pub + dataInjections: + - source: files + target: + selector: app.kubernetes.io/name=podinfo-upgrade + namespace: podinfo-upgrade + container: podinfo + path: /home/app/service.yaml actions: onDeploy: after: @@ -26,3 +42,9 @@ components: setVariable: PODINFO_COSIGN_PUB - cmd: "echo \"Successfully deployed podinfo ###ZARF_PKG_VAR_PODINFO_VERSION### with the following cosign key:\\n\\n${ZARF_VAR_PODINFO_COSIGN_PUB}\"" - cmd: rm podinfo-cosign.pub + - wait: + cluster: + kind: pod + name: app.kubernetes.io/name=podinfo-upgrade + namespace: podinfo-upgrade + condition: ready