Skip to content

Commit

Permalink
Check code generation as part of release / hashrelease (#9554)
Browse files Browse the repository at this point in the history
* Check code generation as part of release / hashrelease

* Add better error mesg
  • Loading branch information
caseydavenport authored and radTuti committed Dec 5, 2024
1 parent 9baedac commit 04d89ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions release/pkg/manager/calico/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ func (r *CalicoManager) PreReleaseValidate(ver string) error {
return fmt.Errorf("current branch (%s) is not a release branch", branch)
}
}

// Check that we're not already on a git tag.
out, err := r.git("describe", "--exact-match", "--tags", "HEAD")
if err == nil {
Expand All @@ -380,6 +381,11 @@ func (r *CalicoManager) PreReleaseValidate(ver string) error {
return fmt.Errorf("Attempt to release from a shallow clone is not possible")
}

// Check that code generation is up-to-date.
if _, err := r.runner.RunInDir(r.repoRoot, "make", []string{"generate", "get-operator-crds", "check-dirty"}, nil); err != nil {
return fmt.Errorf("code generation error (try 'make generate' and/or 'make get-operator-crds' ?): %s", err)
}

// Assert that manifests are using the correct version.
err = r.assertManifestVersions(ver)
if err != nil {
Expand Down

0 comments on commit 04d89ff

Please sign in to comment.