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

Kubebuilder is not generating openapi files #1129

Closed
camilamacedo86 opened this issue Oct 25, 2019 · 8 comments
Closed

Kubebuilder is not generating openapi files #1129

camilamacedo86 opened this issue Oct 25, 2019 · 8 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Oct 25, 2019

Following the steps

  • Following the quickstart
  • Add // +k8s:openapi-gen=true for Guestbook as follows
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=guestbooks,scope=Guestbook
type Guestbook struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   GuestbookSpec   `json:"spec,omitempty"`
	Status GuestbookStatus `json:"status,omitempty"`
}
  • Run make

What I expected?
See api/v1/zz_generated.openapi.go file.

  • go version 1.13
  • kubebuilder version (kubebuilder version) : version: "2"
  • controller-runtime version (check your go.mod file) sigs.k8s.io/controller-runtime v0.3.0

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2019
@DirectXMan12
Copy link
Contributor

right. That's not a bug. KubeBuilder is not intended to generate go openapi files, since they're not useful for CRDs (they're basically only useful for aggregated API servers, and even then you can just bundle in the JSON/YAML form and parse on init).

@camilamacedo86
Copy link
Member Author

Thank you for the answers

@gclawes
Copy link

gclawes commented Nov 26, 2019

Is there a way to generate openapi specs for kubebuilder CRDs? They are useful for generating client libraries in other languages (python, go, java, etc).

@camilamacedo86
Copy link
Member Author

Hi @gclawes,

Could you please raise a new issue to request this support with a summary and clear description of the uses cases which justify the kubebuilder support to generate openapi specs?

@gclawes
Copy link

gclawes commented Nov 26, 2019

Sure!

@camilamacedo86
Copy link
Member Author

HI @gclawes could you raise the issue? If yes, could you please add the link here?

@gclawes
Copy link

gclawes commented Nov 27, 2019

Yes, I'll raise an issue. Haven't had time to do a write-up yet.

@gclawes
Copy link

gclawes commented Dec 1, 2019

@camilamacedo86 opened #1231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants