-
Notifications
You must be signed in to change notification settings - Fork 1.8k
operator-sdk fails to add an api on brand new project #2725
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
Maybe the operator-sdk cann't get your [pzghost@localhost app-operator]$ echo $GOROOT
[pzghost@localhost app-operator]$ 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/group.go
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.example.com_v1alpha1_appservice_cr.yaml
INFO[0000] Running deepcopy code-generation for Custom Resource group versions: [app:[v1alpha1], ]
F0326 17:43:26.216455 23113 deepcopy.go:885] Hit an unsupported type invalid type for invalid type, from app-operator/pkg/apis/app/v1alpha1.AppService
[pzghost@localhost app-operator]$ rm -rf pkg/apis/
[pzghost@localhost app-operator]$ export GOROOT=/usr/local/go
[pzghost@localhost app-operator]$ 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/group.go
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.example.com_v1alpha1_appservice_cr.yaml
INFO[0000] RBAC rules in deploy/role.yaml already up to date for the resource (app.example.com/v1alpha1, AppService)
INFO[0000] Running deepcopy code-generation for Custom Resource group versions: [app:[v1alpha1], ]
INFO[0008] Code-generation complete.
INFO[0008] Running CRD generator.
INFO[0008] CRD generation complete.
INFO[0008] API generation complete.
|
That is my GOROOT as well: $ go env GOROOT
/usr/local/go If that is default why do I have to set it again? |
This is a known issue. See #1854 (comment) If setting GOROOT doesn't resolve this, we can re-open. |
@joelanford I can see, that PR #2754 introduce to set GOROOT on k8s generating and create API. I tried to call $ operator-sdk version uname -a |
Bug Report
What did you do?
I was following the Quick Start guide to create a project and when add api it fails with error,
Hit an unsupported type invalid type for invalid type, from ./pkg/apis/app/v1alpha1.AppService
.What did you see instead? Under which circumstances?
This is the error I saw in a brand new project:
Environment
55f1446
minikube
golang
The text was updated successfully, but these errors were encountered: