operator-sdk: cannot find module providing package
What did you do? I following the guide to add example-inc API, but got cannot find module providing package:
$ operator-sdk add api --api-version=app.example.com/v1alpha1 --kind=AppService
INFO[0000] Generating api version app.example.com/v1alpha1 for kind AppService.
INFO[0000] Created pkg/apis/app/v1alpha1/appservice_types.go
INFO[0000] Created pkg/apis/addtoscheme_app_v1alpha1.go
INFO[0000] Created pkg/apis/app/v1alpha1/register.go
INFO[0000] Created pkg/apis/app/v1alpha1/doc.go
INFO[0000] Created deploy/crds/app_v1alpha1_appservice_cr.yaml
W0530 09:51:53.863324 20942 parse.go:239] Ignoring child directory github.com/example-inc/app-operator/pkg/apis/app: unable to import "github.com/example-inc/app-operator/pkg/apis/app": go/build: importGo github.com/example-inc/app-operator/pkg/apis/app: exit status 1
can't load package: package github.com/example-inc/app-operator/pkg/apis/app: unknown import path "github.com/example-inc/app-operator/pkg/apis/app": cannot find module providing package github.com/example-inc/app-operator/pkg/apis/app
INFO[0013] Created deploy/crds/app_v1alpha1_appservice_crd.yaml
Error: exit status 1
Usage:
operator-sdk add api [flags]
Flags:
--api-version string Kubernetes APIVersion that has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)
-h, --help help for api
--kind string Kubernetes resource Kind name. (e.g AppService)
Global Flags:
--verbose Enable verbose loggin
What did you expect to see? I pass without error
What did you see instead? Under which circumstances? I use the operator-sdk v0.8.1 release and make install to build and install.
Environment
-
operator-sdk version:
operator-sdk version: v0.8.1, commit: 33b3bfe10176f8647f5354516fff29dea42b6342 -
Kubernetes version information:
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:05:32Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"} -
Kubernetes cluster kind:
minikube -
go version:
go version go1.12 linux/amd64 -
go variables:
GO111MODULE=on
GOPATH=/home/user/go
GOROOT=/usr/lib/go-1.12/bin/
- current directory:
/home/user/go/src/github.com/example-inc/app-operator
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (6 by maintainers)
Commits related to this issue
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
- storage-operator: add package file to `pkg/apis/storage` Without such file in place, code-generation using `operator-sdk generate openapi` tends to fail. This is fixed in later versions of `operator-... — committed to scality/metalk8s by NicolasT 5 years ago
@mossuchida yes, see #1546