Skip to content

operator-sdk generate openapi ignores +kubebuilder:printcolumn #1212

@nrvnrvn

Description

@nrvnrvn

Bug Report

What did you do?
added the following annotation:

// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.Replicas",description="The number of MyCoolCRD instances"
type MyCoolCRD struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MyCoolCRDSpec   `json:"spec,omitempty"`
	Status MyCoolCRDStatus `json:"status,omitempty"`
}

What did you expect to see?
Expected to see it in the generated CRD.

What did you see instead? Under which circumstances?

$ GOFLAGS="-v" operator-sdk generate openapi
INFO[0001] Running OpenAPI code-generation for Custom Resource group versions: [k8s:[v1alpha1], ] 
2019/03/15 14:36:53 Code for OpenAPI definitions generated

[debug] name="Replicas"
[debug] type="integer"
[debug] JSONPath=".spec.Replicas"
[debug] description="The number of MyCoolCRD instances"INFO[0004] Created deploy/crds/k8s_v1alpha1_woot_crd.yaml 
INFO[0004] Code-generation complete. 

Environment

  • operator-sdk version:
    operator-sdk version v0.5.0+git

  • Kubernetes version information:

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-03-01T23:34:27Z", GoVersion:"go1.12", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:30:26Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

  • Kubernetes cluster kind:

  • Are you writing your operator in ansible, helm, or go?
    go

Possible Solution

Additional context
If it is an upstream issue please advise the repo to report and probably to fix it. Kubebuilder looks great as a tool but it looks a bit immature at the same time. I've run in a number of issues possibly related to kubebuilder in a couple of days and don't want to flood here ) And I see that there are other people complaining about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions