[DNM][TEST][operator_build] Use local path replace for go.mod in meta operator#4075
[DNM][TEST][operator_build] Use local path replace for go.mod in meta operator#4075lmiccini wants to merge 4 commits into
Conversation
The go mod edit -replace command was using a remote module reference
with a raw commit SHA (e.g. github.com/user/repo@sha), which requires
go mod tidy to resolve the SHA to a pseudo-version via the Go module
proxy. In CI environments where the proxy cannot reach fork
repositories, go mod tidy silently fails (no set -e), leaving the
raw SHA in go.mod. The subsequent go work use then fails with
"version must be of the form v1.2.3".
Fix by using local path replaces instead — the operator source is
already checked out at {{ operator.src }}, so no network access or
version resolution is needed. Also add set -e to surface any future
failures immediately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 44m 31s |
The previous fix used local path replaces which broke the bindata step — pin-bundle-images.sh parses go.mod replace directives to extract commit SHAs for bundle image tags, and local paths have no version info. Instead, construct a proper Go pseudo-version (v0.0.0-DATE-HASH) from the commit metadata before calling go mod edit. This gives a valid go.mod version that both go work use and pin-bundle-images.sh can handle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
git --date=format: uses the commit's original timezone, not UTC. Go pseudo-versions require UTC timestamps. Switch to --date=format-local: with TZ=UTC to convert correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
go mod tidy resolves raw commit SHAs to proper pseudo-versions, but its failure was silently swallowed because the shell scripts lacked set -e — the trailing if [ -d ./apis ] returned 0 even when go mod tidy failed, masking the error. The unresolved raw SHA then caused go work use to fail with "version must be of the form v1.2.3". Adding set -e ensures go mod tidy failures surface immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 35m 41s |
The go mod edit -replace command was using a remote module reference with a raw commit SHA (e.g. github.com/user/repo@sha), which requires go mod tidy to resolve the SHA to a pseudo-version via the Go module proxy. In CI environments where the proxy cannot reach fork repositories, go mod tidy silently fails (no set -e), leaving the raw SHA in go.mod. The subsequent go work use then fails with "version must be of the form v1.2.3".
Fix by using local path replaces instead — the operator source is already checked out at {{ operator.src }}, so no network access or version resolution is needed. Also add set -e to surface any future failures immediately.