Skip to content

Commit

Permalink
Document root CRD objects as API resource types.
Browse files Browse the repository at this point in the history
When finding the set of root CRD types, the documentation
generator checks for the `+genclient` annotation, ratherd
than the newer `+kubebuilder:object:root`.

Adding `+genclient` makes the root CRD type objects appear in the
resource list at the head of the API documentation, which improves
their visibility.

Signed-off-by: James Peach <jpeach@vmware.com>
  • Loading branch information
jpeach committed Jun 4, 2020
1 parent 7b07da9 commit 366f0e5
Show file tree
Hide file tree
Showing 7 changed files with 553 additions and 431 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha1/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ type HTTPRoute struct {
Status HTTPRouteStatus `json:"status,omitempty" protobuf:"bytes,4,opt,name=status"`
}

// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true

// HTTPRouteList contains a list of HTTPRoute
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/tcproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type TcpRouteStatus struct {
// Important: Run "make" to regenerate code after modifying this file
}

// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true

// TcpRoute is the Schema for the tcproutes API
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/trafficsplit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type TrafficSplitStatus struct {
// Important: Run "make" to regenerate code after modifying this file
}

// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true

// TrafficSplit is the Schema for the trafficsplits API
Expand Down
Loading

0 comments on commit 366f0e5

Please sign in to comment.