From 9589f09296f5e6a4e08c0fb4a3f4df18e85bf298 Mon Sep 17 00:00:00 2001 From: Mason Malone <651224+MasonM@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:07:18 -0800 Subject: [PATCH] ci: add step to validate release manifests As requested in https://github.com/argoproj/argo-workflows/pull/14044#discussion_r1917576753, this adds a simple step to each E2E suite that validates the release manifests using server-side field validation. This is intended to catch simple issues, e.g. typos in a field: ``` $ make manifests-validate deployment.apps/postgres serverside-applied (server dry run) The CustomResourceDefinition "clusterworkflowtemplates.argoproj.io" is invalid: * spec.validation.openAPIV3Schema.properties[apiVersion].type: Invalid value: "TYPO": must be string * spec.validation.openAPIV3Schema.properties[apiVersion].type: Unsupported value: "TYPO": supported values: "array", "boolean", "integer", "number", "object", "string" make: *** [Makefile:452: manifests-validate] Error 1 ``` Signed-off-by: Mason Malone <651224+MasonM@users.noreply.github.com> --- .github/workflows/ci-build.yaml | 2 ++ Makefile | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index e185e91e9a12..69ecd44dcb55 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -362,6 +362,8 @@ jobs: POD_STATUS_CAPTURE_FINALIZER=true 2>&1 | tee /tmp/argo.log & make wait PROFILE=${{matrix.profile}} API=${{matrix.use-api}} timeout-minutes: 5 + - name: Validate release manifests + run: make manifests-validate - name: Run tests ${{matrix.test}} run: make ${{matrix.test}} E2E_SUITE_TIMEOUT=20m STATIC_FILES=false diff --git a/Makefile b/Makefile index 4934001a320c..71c80000f0e3 100644 --- a/Makefile +++ b/Makefile @@ -447,6 +447,10 @@ dist/manifests/%: manifests/% # lint/test/etc +.PHONE: manifests-validate +manifests-validate: + kubectl apply --server-side --validate=strict --dry-run=server -f 'manifests/*.yaml' + $(GOPATH)/bin/golangci-lint: Makefile curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.61.0