diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c79d60a76..88cf78a1f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -238,6 +238,43 @@ jobs: version: ${{ needs.process-inputs.outputs.NEXT_PATCH_PRE_WITHOUT_V }} commit: true + test: + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: read + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: ./.github/actions/setup_nix + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - name: Log in to ghcr.io Container registry + uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Azure + uses: azure/login@6b2456866fc08b011acb422a92a4aa20e2c4de32 # v2.1.0 + with: + creds: ${{ secrets.CONTRAST_CI_INFRA_AZURE }} + - uses: nicknovitski/nix-develop@a2060d116a50b36dfab02280af558e73ab52427d # v1.1.0 + - name: Create justfile.env + run: | + cat < justfile.env + container_registry=${{ env.container_registry }} + azure_resource_group=${{ env.azure_resource_group }} + EOF + - name: Get credentials for CI cluster + run: | + just get-credentials + - name: E2E Test + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + nix shell .#contrast.e2e --command release.test -test.v --tag ${{ inputs.version }} + create-github-stuff: name: Create backport label and milestone if: ${{ inputs.kind == 'minor' }} diff --git a/e2e/release/release_test.go b/e2e/release/release_test.go index e643654b86..f5d97bc31b 100644 --- a/e2e/release/release_test.go +++ b/e2e/release/release_test.go @@ -94,7 +94,7 @@ func TestRelease(t *testing.T) { require.NoError(err) for _, r := range resources { - require.NoError(k.PatchNamespace(*namespace, r)) + r.SetNamespace(*namespace) } require.NoError(k.Apply(ctx, resources...)) @@ -118,13 +118,12 @@ func TestRelease(t *testing.T) { for _, info := range infos { name := path.Join(path.Join(dir, "deployment"), info.Name()) yaml, err := os.ReadFile(name) - resources, err := kubeapi.UnmarshalUnstructuredK8SResource(yaml) + require.NoError(err) + resources, err := kubeapi.UnmarshalK8SResources(yaml) require.NoError(err) - for _, r := range resources { - require.NoError(k.PatchNamespace(*namespace, r)) - } - newYAML, err := kuberesource.EncodeUnstructured(resources) + resources = kuberesource.PatchNamespaces(resources, *namespace) + newYAML, err := kuberesource.EncodeResources(resources...) require.NoError(err) require.NoError(os.WriteFile(name, newYAML, 0o644))