-
Notifications
You must be signed in to change notification settings - Fork 228
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
fix: Solving make run
errors under Go vendor mode.
#1807
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,14 @@ set -o nounset | |
set -o pipefail | ||
|
||
GO_CMD=${1:-go} | ||
KUEUE_ROOT=$(realpath $(dirname ${BASH_SOURCE[0]})/..) | ||
CODEGEN_PKG=$($GO_CMD list -m -f "{{.Dir}}" k8s.io/code-generator) | ||
|
||
cd $(dirname ${BASH_SOURCE[0]})/.. | ||
|
||
KUEUE_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]})"/..)) | ||
if [ -d "vendor" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you have a vendor folder? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
"The 'go mod vendor' command automatically generates the 'vendor' directory. If this command is not used to copy dependencies to the project space, the GoLang editor cannot automatically locate dependencies such as 'sigs.k8s.io/controller-runtime', resulting in red error indicators indicating that the dependencies cannot be found." |
||
CODEGEN_PKG=$($GO_CMD list -m -f "vendor/k8s.io/code-generator" k8s.io/code-generator) | ||
else | ||
CODEGEN_PKG=$($GO_CMD list -m -f "{{.Dir}}" k8s.io/code-generator) | ||
fi | ||
|
||
cd $(dirname "${BASH_SOURCE[0]}")/.. | ||
source "${CODEGEN_PKG}/kube_codegen.sh" | ||
|
||
# TODO: remove the workaround when the issue is solved in the code-generator | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controller-gen
should use the version set in go.modThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Please revert this line, as the version is locked in go.mod #1720
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.