-
Notifications
You must be signed in to change notification settings - Fork 1.8k
user-guide on a fresh install (for go) #1688
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
Comments
@p-sforza you should include The reason is - when you run outside the GOPATH, the SDK can't figure out the import path to use for the operator so you have to specify
|
@johananl well I think it seems to be a bit more peculiar in my case
then the same for dir >/root/go/
Any good thought ? |
Hi johananl, Best regards |
@nzaharioudakis you have two options: Option 1
Option 2
I personally use option 2.
EDIT: Actually |
@vincmarz cool. I'm guessing you have |
@johananl Yes, I did it |
Does this mean that the dependecies for the project will be in $GOPATH/src/github.com/yourgithubuser/test-operator |
@Katiyman If I understood your question correctly, when using Go modules any dependencies are downloaded to |
Bug Report
What did you do?
From a fresh fedora installation (Fedora release 30) I've just followed the quick start in the readme
SDK Setup
RELEASE_VERSION=v0.9.0
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
$ curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
KEY_ID=<KEY_ID>
$ gpg --recv-key "$KEY_ID"
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
--> check ok
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk
Dependency setup
$ dnf install -y git go mercurial bzr origin-clients dep
Quick Start
$ mkdir -p $HOME/projects/example.com/
$ cd $HOME/projects/example.com/
$ operator-sdk new memcached-operator
What did you expect to see?
Completion of the go scaffold setup
What did you see instead? Under which circumstances?
$ operator-sdk new memcached-operator
The cmd breaks with:
Error: dependency manager "modules" requires the flag --repo to be set if the working directory is not in $GOPATH/src. See "operator-sdk new -h"
I've tried
$ operator-sdk new memcached-operator --repo ./
but this breaks after a wile:
can't load package: package .//cmd/manager: non-canonical import path: ".//cmd/manager" should be "cmd/manager"
Environment
operator-sdk version: v0.9.0, commit: 560208d
go version go1.12.7 linux/amd64
Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2018-12-06T15:15:06Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2019-07-08T19:16:39Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}
Kubernetes cluster kind: OKD
Are you writing your operator in ansible, helm, or go?
go
Possible Solution
maybe define the go path... but this is not more required for newer go versions
Additional context
The text was updated successfully, but these errors were encountered: