Skip to content

Commit

Permalink
ci: add step to validate release manifests
Browse files Browse the repository at this point in the history
As requested in
#14044 (comment),
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
<SNIP>
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 <[email protected]>
  • Loading branch information
MasonM committed Jan 16, 2025
1 parent b1a65e7 commit 9589f09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9589f09

Please sign in to comment.