Kustomize: go install sigs.k8s.io/kustomize/v3/cmd/kustomize not working?

Created on 5 Jul 2019  Â·  6Comments  Â·  Source: kubernetes-sigs/kustomize

I may be doing something wrong,

I am trying to build kustomize from source to use the plugins.

I did

➜  ~ DEMO=$(mktemp -d)
➜  ~ tmpGoPath=$(mktemp -d)
➜  ~ GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
````

I get 

can't load package: package sigs.k8s.io/kustomize/v3/cmd/kustomize: cannot find package "sigs.k8s.io/kustomize/v3/cmd/kustomize" in any of:
/usr/local/go/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOROOT)
/var/folders/p2/t22mkzvs23b5r3mjnprktqzh0000gq/T/tmp.GDjh90FQ/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOPATH)

My go version:

➜ ~ go version
go version go1.12.4 darwin/amd64
```

lifecyclrotten

Most helpful comment

To use the versioned import paths with GOPATH set you'll need to also explicitly enable module support with GO111MODULE=on.

For example:

~$ GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
can't load package: package sigs.k8s.io/kustomize/v3/cmd/kustomize: cannot find package "sigs.k8s.io/kustomize/v3/cmd/kustomize" in any of:
        /usr/local/go/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOROOT)
        /tmp/tmp.kCloFcpacO/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOPATH)
~$ GO111MODULE=on GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
go: finding sigs.k8s.io/kustomize/v3/cmd/kustomize latest
go: finding sigs.k8s.io/kustomize/v3/cmd latest
...

All 6 comments

Try:

GOPATH=$tmpGoPath go get -u sigs.k8s.io/kustomize/cmd/kustomize
GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/cmd/kustomize

To use the versioned import paths with GOPATH set you'll need to also explicitly enable module support with GO111MODULE=on.

For example:

~$ GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
can't load package: package sigs.k8s.io/kustomize/v3/cmd/kustomize: cannot find package "sigs.k8s.io/kustomize/v3/cmd/kustomize" in any of:
        /usr/local/go/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOROOT)
        /tmp/tmp.kCloFcpacO/src/sigs.k8s.io/kustomize/v3/cmd/kustomize (from $GOPATH)
~$ GO111MODULE=on GOPATH=$tmpGoPath go install sigs.k8s.io/kustomize/v3/cmd/kustomize
go: finding sigs.k8s.io/kustomize/v3/cmd/kustomize latest
go: finding sigs.k8s.io/kustomize/v3/cmd latest
...

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

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

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 rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

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

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

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

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.

Was this page helpful?
0 / 5 - 0 ratings