Skip to content

Commit 68fde93

Browse files
author
Eric Stroczynski
authored
doc/user-guide.md: update Go modules support section (#1663)
1 parent 4d13a39 commit 68fde93

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

doc/user-guide.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ If using Go modules (the default dependency manager) in your project, ensure you
4343
> - 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).
4444
> - Invoke the go command with GO111MODULE=on environment variable set.
4545
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-
5446
##### Vendoring
5547

5648
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:
204196

205197
**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.
206198

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+
208201
```sh
209202
$ go mod vendor
210203
```
204+
205+
or if a `Gopkg.toml` file is present run
206+
207+
```sh
208+
$ dep ensure
209+
```
210+
211211
before building the memcached-operator image.
212212

213213
Build the memcached-operator image and push it to a registry:
@@ -413,7 +413,7 @@ func main() {
413413

414414
**NOTES:**
415415

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.
417417
* Your 3rd party resource needs to be added before add the controller in `"Setup all Controllers"`.
418418

419419
### Handle Cleanup on Deletion
@@ -488,7 +488,7 @@ func (r *ReconcileMemcached) Reconcile(request reconcile.Request) (reconcile.Res
488488
func (r *ReconcileMemcached) finalizeMemcached(reqLogger logr.Logger, m *cachev1alpha1.Memcached) error {
489489
// TODO(user): Add the cleanup steps that the operator
490490
// needs to do before the CR can be deleted. Examples
491-
// of finalizers include performing backups and deleting
491+
// of finalizers include performing backups and deleting
492492
// resources that are not owned by this CR, like a PVC.
493493
reqLogger.Info("Successfully finalized memcached")
494494
return nil

0 commit comments

Comments
 (0)