Following the steps
// +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"`
}
makeWhat I expected?
See api/v1/zz_generated.openapi.go file.
kubebuilder version) : version: "2"go.mod file) sigs.k8s.io/controller-runtime v0.3.0/kind bug
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).
Thank you for the answers
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).
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?
Sure!
HI @gclawes could you raise the issue? If yes, could you please add the link here?
Yes, I'll raise an issue. Haven't had time to do a write-up yet.
@camilamacedo86 opened #1231