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
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The committers listed above are authorized under a signed CLA. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: village-way The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @village-way! |
Hi @village-way. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
Signed-off-by: wangdepeng <wangdepeng_yewu@cmss.chinamobile.com>
/easycla |
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.
Do you have a specific use-case for this?
Depending on what you want to do, in my opinion , it's easier to just install
and deploy
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen | ||
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 |
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.mod
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.
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.
Indeed. Please revert this line, as the version is locked in go.mod #1720
I am a novice in Go and Kubernetes development. I wanted to address the following issue, which is why I changed that line of code.
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen | ||
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 |
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.
Indeed. Please revert this line, as the version is locked in go.mod #1720
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
why do you have a vendor folder?
"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."
I just want to start the kueue main.go process and debug the code in the goland, so want to run that in |
I'm not sure why we should have the vendor if we use Goland. |
Can you make sure you are using go v1.21 or newer and that you enable go modules support in golang? https://www.jetbrains.com/help/go/create-a-project-with-go-modules-integration.html#using-go-modules-in-your-project You should not run |
if not run |
Every time GoLand is opened, it executes go list. However, this go list command fails, and it's unclear if this is the cause. Executing go mod vendor is just to allow GoLand to find dependencies without prompting that they can't be found. |
That problem could be fixed by #1345. |
Thank you very much, according to #1345 , this problem can be fixed and we don't need run
|
I don't think so since after #1345 is fixed, we don't need such imports. |
I saw the PR you mentioned at kubernetes/autoscaler#6315. I'm not very familiar with the Go module dependencies, but I roughly understand that the issue arises because the clusterAutoscale is trying to reuse the code from Schedule without it being a separate Go module. However, I'm still quite confused about this area. Could you please help explain why this problem occurred? I'm looking forward to your reply. ♥ |
@tenzen-y do you think we are close to merging the split of cluster-autoscaler packages? |
All tasks have already been done. I'm waiting for approval from @x13n (for CA approval) and @mwielgus (for autoscaler repository approval). Both approvals are necessary. |
Or only approval from @mwielgus should be fine since @x13n already approved that PR. |
k/k repository is not assumed to be used as a go module. This issue might be helpful for you to understand reasons: kubernetes/kubernetes#79384 |
thanks, this pr can be closed as the related issue solved. |
In favor of #1872 |
@tenzen-y: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
@alculquicondor
Does this PR introduce a user-facing change?