Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #213 from onyiny-ang/kubectl-explain
Browse files Browse the repository at this point in the history
Add custom columns to openAPI schema
  • Loading branch information
k8s-ci-robot authored Apr 8, 2018
2 parents 09150e6 + 1e81535 commit 0309542
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,8 @@
"version": "v1alpha1",
"kind": "Cluster"
}
]
],
"x-kubernetes-print-columns": "custom-columns=NAME:.metadata.name,CIDR:.spec.kubernetesApiEndpoints.serverEndpoints[].clientCIDR,SERVER:.spec.kubernetesApiEndpoints.serverEndpoints[].serverAddress,CREATION TIME:.metadata.creationTimestamp"
},
"io.k8s.cluster-registry.pkg.apis.clusterregistry.v1alpha1.ClusterList": {
"description": "ClusterList is a list of Kubernetes clusters in the cluster registry.",
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/clusterregistry/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/clusterregistry/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Cluster contains information about a cluster in a cluster registry.
// +k8s:openapi-gen=x-kubernetes-print-columns:custom-columns=NAME:.metadata.name,CIDR:.spec.kubernetesApiEndpoints.serverEndpoints[].clientCIDR,SERVER:.spec.kubernetesApiEndpoints.serverEndpoints[].serverAddress,CREATION TIME:.metadata.creationTimestamp
type Cluster struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/clusterregistry/v1alpha1/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
},
},
},
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-print-columns": "custom-columns=NAME:.metadata.name,CIDR:.spec.kubernetesApiEndpoints.serverEndpoints[].clientCIDR,SERVER:.spec.kubernetesApiEndpoints.serverEndpoints[].serverAddress,CREATION TIME:.metadata.creationTimestamp",
},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/cluster-registry/pkg/apis/clusterregistry/v1alpha1.ClusterSpec", "k8s.io/cluster-registry/pkg/apis/clusterregistry/v1alpha1.ClusterStatus"},
Expand Down

0 comments on commit 0309542

Please sign in to comment.