Skip to content

fix(ops): resolve binaries from GOBIN before PATH in manifests_regen - #2009

Open
bwplotka wants to merge 1 commit into
mainfrom
gmpctl-use-gobin
Open

fix(ops): resolve binaries from GOBIN before PATH in manifests_regen#2009
bwplotka wants to merge 1 commit into
mainfrom
gmpctl-use-gobin

Conversation

@bwplotka

Copy link
Copy Markdown
Collaborator

Addressing discussion comment #2005 (comment) from #2005.

Instead of strictly using command -v to search $PATH, release-lib::manifests_regen now resolves yq, helm, and addlicense from $GOBIN first (falling back to $PATH if not found in $GOBIN).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ops/gmpctl/lib.sh to resolve tool paths (yq, helm, and addlicense) from the Go binary directory (GOBIN or GOPATH/bin) before falling back to system-wide commands. The review feedback correctly points out that if go is not installed, executing go env will cause the script to crash under errexit. Additionally, if gobin is empty, checking ${gobin}/tool will incorrectly resolve to /tool. The reviewer provides a robust shell script alternative to safely handle these cases.

Comment thread ops/gmpctl/lib.sh Outdated
@bwplotka
bwplotka force-pushed the gmpctl-use-gobin branch 2 times, most recently from 40fbc69 to 52c6ca8 Compare July 24, 2026 22:06
Signed-off-by: bwplotka <bwplotka@google.com>
@bwplotka
bwplotka requested a review from quentinmit July 24, 2026 22:23
Comment thread ops/gmpctl/lib.sh
echo "🔄 Regenerating manifests..."
YQ="$(command -v yq)" HELM="$(command -v helm)" ADDLICENSE="$(command -v addlicense)" bash "${dir}/hack/presubmit.sh" manifests
echo "🔄 Regenerating manifests..."
YQ="${GOBIN}/yq" HELM="${GOBIN}/helm" ADDLICENSE="${GOBIN}/addlicense" bash "${dir}/hack/presubmit.sh" manifests

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Check if PATH change can be ignored later on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant