operator-sdk generate fails to work to work with modules

Created on 1 Jul 2019  路  7Comments  路  Source: operator-framework/operator-sdk

Bug Report

What did you do?

$ operator-sdk generate k8s --verbose
DEBU[0000] Debug logging is set                         
FATA[0000] Project not in $GOPATH  

go.mod and go.sum are present. The project is valid and it can be built manually.

What did you expect to see?
Successfully generating k8s zz_*.generated.go files.

What did you see instead? Under which circumstances?
A clear and concise description of what you expected to happen (or insert a code snippet).

Environment

  • operator-sdk version:
    operator-sdk version: v0.8.1, commit: 33b3bfe10176f8647f5354516fff29dea42b6342
  • go version:
    go version go1.12.6 darwin/amd64

  • Kubernetes version information:
    Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-20T04:49:16Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

  • Kubernetes cluster kind:
    minikube

  • Are you writing your operator in ansible, helm, or go?
    go

Possible Solution

Additional context
Add any other context about the problem here.

Most helpful comment

@nrvnrvn so you are saying this was fixed in master branch but does not work in 0.8.1 release?

We should maybe cherry-pick the fix to the 0.8.2 release? cc @hasbro17 @estroz

All 7 comments

there is no such issue on the master branch. Will stick to it for a while...

@nrvnrvn so you are saying this was fixed in master branch but does not work in 0.8.1 release?

We should maybe cherry-pick the fix to the 0.8.2 release? cc @hasbro17 @estroz

Yes I'll release v0.8.2 today or tomorrow.

@nrvnrvn are you running operator-sdk generate k8s in $GOPATH/src? If not, note that v0.8.x does not support running commands outside of $GOPATH/src. This feature was not quite ready when we released v0.8.0, so the next release to contain full Go modules support will be v0.9.0.

Right, I鈥檇 switched to go modules and that鈥檚 where all the fun began )))

Looks like this issue is solved?

solved with the release of v0.9.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

camilamacedo86 picture camilamacedo86  路  5Comments

flickerfly picture flickerfly  路  5Comments

surajssd picture surajssd  路  3Comments

ricardozanini picture ricardozanini  路  4Comments

danielsig727 picture danielsig727  路  4Comments