diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 896c246..b56c219 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,17 +18,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Zarf - uses: defenseunicorns/setup-zarf@main - with: - # renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver - version: v0.32.4 + - name: Setup UDS + if: always() + uses: defenseunicorns/uds-common/.github/actions/setup@v0.2.1 - - run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash" - shell: bash + - name: Create and deploy the uds-k3d package + run: uds run - - name: Create Zarf Package - run: zarf package create --confirm + - name: Validate uds-k3d package + run: uds run validate - - name: Deploy the capability - run: zarf package deploy zarf-package-uds-k3d-*.tar.zst --confirm diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml index 27bbc03..ed2b46b 100644 --- a/.github/workflows/tag-and-release.yml +++ b/.github/workflows/tag-and-release.yml @@ -32,11 +32,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Zarf - uses: defenseunicorns/setup-zarf@main - with: - # renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver - version: v0.32.4 + - name: Setup UDS + if: always() + uses: defenseunicorns/uds-common/.github/actions/setup@v0.2.1 - name: Login to GHCR uses: docker/login-action@v3 @@ -47,5 +45,5 @@ jobs: - name: Publish the capability run: | - zarf package create --confirm -a arm64 -o oci://ghcr.io/defenseunicorns/packages - zarf package create --confirm -a amd64 -o oci://ghcr.io/defenseunicorns/packages + uds zarf package create --confirm -a arm64 -o oci://ghcr.io/defenseunicorns/packages + uds zarf package create --confirm -a amd64 -o oci://ghcr.io/defenseunicorns/packages diff --git a/tasks.yaml b/tasks.yaml new file mode 100644 index 0000000..6701c49 --- /dev/null +++ b/tasks.yaml @@ -0,0 +1,29 @@ +tasks: + - name: default + description: "Build and deploy uds-k3d" + actions: + - description: "Build UDS K3d package" + cmd: "uds zarf package create --confirm" + + - description: "Deploy UDS K3d package" + cmd: "uds zarf package deploy zarf-package-uds-k3d-*.tar.zst --confirm" + + - name: validate + actions: + - description: Validate coredns is up + wait: + cluster: + kind: Pod + name: "k8s-app=kube-dns" + namespace: kube-system + condition: Ready + - description: Validate coredns is resolving *.uds.dev internally + cmd: | + set -e + FOO_IP=$(uds zarf tools kubectl run dig-test --image=arunvelsriram/utils -q --restart=Never --rm -i -- dig +short foo.uds.dev) + if [ "${FOO_IP}" != "127.0.0.1" ]; then + echo "CoreDNS is resolving foo.uds.dev to host.k3d.internal" + else + echo "CoreDNS patch failed, foo.uds.dev is resolving to 127.0.0.1" + exit 1 + fi