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
argoproj#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 3ff1ccd
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 @@ -322,6 +322,8 @@ jobs:
echo " user:" >> $KUBECONFIG
echo " token: xxxxxx" >> $KUBECONFIG
until kubectl cluster-info ; do sleep 10s ; done
- name: Validate release manifests
run: make manifests-validate
- name: Download images
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
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 3ff1ccd

Please sign in to comment.