You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user-guide.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,6 @@ If using Go modules (the default dependency manager) in your project, ensure you
43
43
> - Invoke the go command in a directory outside of the $GOPATH/src tree, with a valid go.mod file in the current directory or any parent of it and the environment variable GO111MODULE unset (or explicitly set to auto).
44
44
> - Invoke the go command with GO111MODULE=on environment variable set.
45
45
46
-
As of now, the SDK only supports initializing new projects in `$GOPATH/src`. We intend to support all go module modes for projects in the near future.
47
-
48
-
You can set `GO111MODULE` in your CLI to activate currently supported behavior by running the following command:
49
-
50
-
```sh
51
-
$ export GO111MODULE=on
52
-
```
53
-
54
46
##### Vendoring
55
47
56
48
By default, an operator's dependencies are managed with `modules` and `--vendor=false`, so calls to `go {build,clean,get,install,list,run,test}` by `operator-sdk` subcommands will use an external modules directory. Execute `go help modules` for more information.
@@ -204,10 +196,18 @@ Once this is done, there are two ways to run the operator:
204
196
205
197
**Note**: `operator-sdk build` invokes `docker build` by default, and optionally `buildah bud`. If using `buildah`, skip to the `operator-sdk build` invocation instructions below. If using `docker`, make sure your docker daemon is running and that you can run the docker client without sudo. You can check if this is the case by running `docker version`, which should complete without errors. Follow instructions for your OS/distribution on how to start the docker daemon and configure your access permissions, if needed.
206
198
207
-
**Note**: If using Go modules and a `vendor/` directory, run
199
+
**Note**: If a `go.mod` file and a `vendor/` directory are present, run
200
+
208
201
```sh
209
202
$ go mod vendor
210
203
```
204
+
205
+
or if a `Gopkg.toml` file is present run
206
+
207
+
```sh
208
+
$ dep ensure
209
+
```
210
+
211
211
before building the memcached-operator image.
212
212
213
213
Build the memcached-operator image and push it to a registry:
@@ -413,7 +413,7 @@ func main() {
413
413
414
414
**NOTES:**
415
415
416
-
* After adding new import paths to your operator project, run `go mod vendor` if using modules and a `vendor/` directory (or `dep ensure` if you set `--dep-manager=dep` when initializing your project) in the root of your project directory to fulfill these dependencies.
416
+
* After adding new import paths to your operator project, run `go mod vendor` if a `go.mod` file and a `vendor/` directory are present (or `dep ensure` if a `Gopkg.toml` file is present) in the root of your project directory to fulfill these dependencies.
417
417
* Your 3rd party resource needs to be added before add the controller in `"Setup all Controllers"`.
0 commit comments