Skip to content

cannot find module providing package #1502

@qw1mb0

Description

@qw1mb0

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions