Minikube: make fails with vm_assets.go:153:19: undefined: Asset

Created on 27 Mar 2018  路  13Comments  路  Source: kubernetes/minikube

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug Report

Please provide the following details:

Environment:

Minikube version (use minikube version): master@fe881662de7ddbb6046013abb8e644534d3149ab

  • OS (e.g. from /etc/os-release): Mac High Sierra v10.13.3
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): virtualbox
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): 0.25.0
  • Install tools:
  • Others: go1.10, docker for mac v18.03.0-ce-mac59 (23608)

What happened: make failed with the following error /usr/local/go/src/k8s.io/minikube/pkg/minikube/assets/vm_assets.go:153:19: undefined: Asset

What you expected to happen: make to succeed

How to reproduce it (as minimally and precisely as possible): Follow the build guide, and when attempting make it will fail with the above error. Error appears to be on line 125 of the Makefile.

Output of minikube logs (if applicable):

Anything else do we need to know: This appears similar to issue #1735. The primary difference is I am following the guide exactly as outlined. Yet I have only succeeded in cloning the repository. From what I see, the code at vm_assets.go:153 appears to be valid, although I am not a Go expert. Is there something that perhaps I am doing incorrectly?

arebuild-release kinbug

All 13 comments

Was pkg/minikube/assets/assets.go created OK ? Can you try re-creating it ?
It is _supposed_ to be generated by make, by installing the go-bindata program

pkg/minikube/assets/assets.go: $(GOPATH)/bin/go-bindata $(shell find deploy/addons -type f)
        $(GOPATH)/bin/go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...

$(GOPATH)/bin/go-bindata:
        GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...

Part of the go-bindata I discovered, was it didn't work exactly, because of the instance of jteeuwen deleting their account. I do recall having to do something a bit different to get it working. Specifically, I ended up getting it from a different account, as the revived jteeuwen was not working as expected for me.

That being said, I did just go and run the above commands you mentioned manually, and so far no change.

That being said, I am getting a deploy/addons not existing (Read: No such file or directory error), on running the above command.

Is it possible that the incident regarding the jteeuwen account deletion, introduced a regression scenario, that now altered what needed to be done via the Makefile?

Hmm, deploy/addons is supposed to be found in your repository (where the command is run from)

$ find deploy/addons -type f
deploy/addons/ingress/ingress-rc.yaml
deploy/addons/ingress/ingress-configmap.yaml
deploy/addons/ingress/ingress-svc.yaml
...

Pardon my beginner level, as I mentioned, I am not a Golang expert, in fact I would consider myself a novice. Is that supposed to be something that comes with the setup and installation of the Golang, or the go-bindata, or something completely different? Based on what you described, it should be one of the latter two options?

Well, "completely different" then - it is a part of minikube sources:
https://github.com/kubernetes/minikube/tree/master/deploy/addons

https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md#building-from-source
Go is supposed to be installed, but the other tools should be fetched.

ah, how silly of me. I just executed the first command you posted, from the minikube root directory, and kicked off another make. Unfortunately, I am still getting the same issue, I have been experiencing from the beginning.

Go is installed, and working as best I know it can. I verified that by running one of the very basic examples they posted.

In terms of the build_guide. That was the guide I was using before I posted this here. Including a full wipe of the repo, and copy-pasting, exactly what is posted there. I know I have $GOPATH and $GOROOT defined correctly. Is there something obvious that I am missing?

It seems like your issue is some problem with go-bindata, perhaps from your earlier manual install ?

So the first thing to try would be to re-install, both bin/go-bindata and src/github.com/jteeuwen/go-bindata

The generated file is supposed to look something like this: pkg/minikube/assets/assets.go

Please note that some files are installed outside the git repository, inside the $GOPATH.

I would like to point out that I had to get go-bindata to be able to build with make:

go get -u github.com/jteeuwen/go-bindata/...

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

FWIW, I ran into this to running "make e2e-linux-amd64". The experience is not user friendly at all:

GOPATH=/usr/local/google/home/tstromberg/go ./makedepend.sh out/docker-machine-driver-kvm2 k8s.io ./cmd/drivers/kvm/  > out/docker-machine-driver-kvm2.d
GOPATH=/usr/local/google/home/tstromberg/go ./makedepend.sh out/storage-provisioner k8s.io ./cmd/storage-provisioner  > out/storage-provisioner.d
GOPATH=/usr/local/google/home/tstromberg/go ./makedepend.sh out/docker-machine-driver-hyperkit k8s.io ./cmd/drivers/hyperkit  > out/docker-machine-driver-hyperkit.d
which go-bindata || GOBIN=/usr/local/google/home/tstromberg/go/bin go get github.com/jteeuwen/go-bindata/...
PATH="/usr/local/google/home/tstromberg/bin:/usr/local/google/home/tstromberg/go/bin:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/google/home/tstromberg/go/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
GOPATH=/usr/local/google/home/tstromberg/go ./makedepend.sh -t test k8s.io ./... pkg/minikube/assets/assets.go > out/test.d
can't load package: package github.com/kubernetes/minikube: no Go files in /usr/local/google/home/tstromberg/go/src/github.com/kubernetes/minikube
GOPATH=/usr/local/google/home/tstromberg/go ./makedepend.sh out/minikube-linux-amd64 k8s.io ./cmd/minikube/ pkg/minikube/assets/assets.go > out/minikube.d
Makefile:104: Warning: Building minikube outside the GOPATH, should be /usr/local/google/home/tstromberg/go/src/k8s.io/minikube but is /usr/local/google/home/tstromberg/go/src/github.com/kubernetes/minikube
GOOS=linux GOARCH=amd64 go build -tags "container_image_ostree_stub containers_image_openpgp" -ldflags="-X k8s.io/minikube/pkg/version.version=v0.28.2 -X k8s.io/minikube/pkg/version.isoVersion=v0.28.1 -X k8s.io/minikube/pkg/version.isoPath=minikube/iso" -a -o out/minikube-linux-amd64 k8s.io/minikube/cmd/minikube
# k8s.io/minikube/pkg/minikube/assets
../../../k8s.io/minikube/pkg/minikube/assets/vm_assets.go:153:19: undefined: Asset
Makefile:104: recipe for target 'out/minikube-linux-amd64' failed

With the recent warning messages in the Makefile (417ab9941bcb6f51ed840454ba00a73112c2008b), this should no longer happen.

I would like to point out that I had to get go-bindata to be able to build with make:

go get -u github.com/jteeuwen/go-bindata/...

for Windows this was on %User%/go/bin/go-bindata .. had to append this to path env and restart the prompt and it worked.

Adding $GOPATH/bin to PATH is supposed to be part of the setup.
See e.g. https://golang.org/doc/code.html#GOPATH

Was this page helpful?
0 / 5 - 0 ratings