Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Building binary fails in v0.11 #160

Open
FraPazGal opened this issue Nov 10, 2021 · 3 comments
Open

Building binary fails in v0.11 #160

FraPazGal opened this issue Nov 10, 2021 · 3 comments

Comments

@FraPazGal
Copy link

Hello all,

As the title says, I'm having trouble compiling the go binary by running:

$ CGO_ENABLED=0 GOOS=linux GO11MODULE=on go build -mod=vendor -a .

vendor/k8s.io/client-go/discovery/discovery_client.go:31:2: cannot find package "."

I'm using Golang 1.17 and building the latest 0.11 version. I have seen the same error in the GitHub CI, so I'm inclined to believe there is an issue in the released files.

Thanks in advance,
Francisco de Paz

@petchumpriwan
Copy link

petchumpriwan commented Nov 12, 2021

@FraPazGal I got similar issues with errors in the GitHub CI. The reason is caused by git doesn't detect folder name change. you can fix this by follow this or if you just clone the repo, just remove vendor folder and run go mod vendor

@FraPazGal
Copy link
Author

That was a nice solution @petchumpriwan, thanks for the help! I suppose the vendor folder was not updated before the release and that is the cause of the issue.

@petchumpriwan
Copy link

petchumpriwan commented Nov 16, 2021

When I read my reply again, I think I type something that quite not clear and mislead the cause. Let's me give more information on that

  • vendor folder was updated in b3e76c6 before v0.11 release
  • For my case, I got an error similar to this
Error: vendor/k8s.io/client-go/discovery/discovery_client.go:31:2: cannot find package "." in:
	/home/runner/work/kubernetes-event-exporter/kubernetes-event-exporter/vendor/github.com/googleapis/gnostic/openapiv2
  • I think it was caused by owner git setting being somehow has been set to case-insensitive, so it did not see that OpenAPIv2 folder is changed to all lowercase in the newer version, then it's break the building process

vendor/github.com/googleapis/gnostic/OpenAPIv2 → vendor/github.com/googleapis/gnostic/openapiv2

  • The folder name is still OpenAPIv2 in current commit

😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants