Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add step to validate release manifests #14089

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

MasonM
Copy link
Contributor

@MasonM MasonM commented Jan 16, 2025

Motivation

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 very fast (~2s) and is intended to catch syntactic issues, e.g. bugs in hack/manifests/crds.go.

Modifications

Add make manifests-validate that runs kubectl apply with --dry-run=server to validate the manifests without actually applying them.

Verification

Edited manifests/quick-start-minimal.yaml and changed this line:

to type: TYPO, then ran make manifests-validate to ensure it correctly caught the issue:

$ 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

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]>
@MasonM MasonM force-pushed the add-manifest-validate branch from 3ff1ccd to 9589f09 Compare January 16, 2025 04:20
@MasonM
Copy link
Contributor Author

MasonM commented Jan 16, 2025

/retest

@MasonM MasonM marked this pull request as ready for review January 16, 2025 05:03
@MasonM MasonM requested a review from terrytangyuan January 16, 2025 05:03
@MasonM MasonM added area/build Build or GithubAction/CI issues area/manifests labels Jan 16, 2025
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@terrytangyuan terrytangyuan merged commit ff60e2f into argoproj:main Jan 16, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build or GithubAction/CI issues area/manifests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants