Skip to content
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

runtime error when trying the example #8

Open
xial-thu opened this issue Nov 12, 2019 · 0 comments
Open

runtime error when trying the example #8

xial-thu opened this issue Nov 12, 2019 · 0 comments

Comments

@xial-thu
Copy link

Hi, I'm trying to validate v1.PodSpec in my crd and luckily I've found this handy tool.

I've tried the example by getting code-generator, checking out to release 1.8 and then go install.
Afterwards, I tried ~/go/bin/openapi-gen -i $(REPO)/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1 -p ./v1 --go-header-file="../../.header" and get the following output:

F1112 13:46:16.763309 29062 openapi.go:126] Got nil output package:
goroutine 1 [running]:
k8s.io/code-generator/vendor/github.com/golang/glog.stacks(0xc00a31b500, 0xc00a1d8be0, 0x4c, 0x9d)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/github.com/golang/glog/glog.go:766 +0xb8
k8s.io/code-generator/vendor/github.com/golang/glog.(*loggingT).output(0x19dd700, 0xc000000003, 0xc00a018a80, 0x196886a, 0xa, 0x7e, 0x0)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/github.com/golang/glog/glog.go:717 +0x351
k8s.io/code-generator/vendor/github.com/golang/glog.(*loggingT).printf(0x19dd700, 0xc000000003, 0x15a8984, 0x1a, 0xc0090d7cd0, 0x1, 0x1)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/github.com/golang/glog/glog.go:655 +0x14b
k8s.io/code-generator/vendor/github.com/golang/glog.Fatalf(...)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/github.com/golang/glog/glog.go:1145
k8s.io/code-generator/vendor/k8s.io/kube-openapi/pkg/generators.Packages(0xc00a18ad80, 0xc0004c4380, 0x15a29fc, 0xd, 0xc00a18ad80)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go:126 +0x6e2
k8s.io/code-generator/vendor/k8s.io/gengo/args.(*GeneratorArgs).Execute(0xc0004c4380, 0xc0090d7e10, 0x15a29fc, 0xd, 0x15c1b40, 0x9c54, 0xfe00)
/Users/xialei1/go/src/k8s.io/code-generator/vendor/k8s.io/gengo/args/args.go:165 +0x207
main.main()
/Users/xialei1/go/src/k8s.io/code-generator/cmd/openapi-gen/main.go:39 +0x242
make: *** [v1/openapi_generated.go] Error 255

I guess it's related to kube-openapi version. Would you specify the environment, such as by adding go.mod?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant