Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (66 sloc) 1.94 KB
package v1alpha1
import (
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
crdutils "kmodules.xyz/client-go/apiextensions/v1beta1"
"kubedb.dev/apimachinery/apis"
)
var _ apis.ResourceInfo = &EtcdVersion{}
func (p EtcdVersion) ResourceShortCode() string {
return ResourceCodeEtcdVersion
}
func (p EtcdVersion) ResourceKind() string {
return ResourceKindEtcdVersion
}
func (p EtcdVersion) ResourceSingular() string {
return ResourceSingularEtcdVersion
}
func (p EtcdVersion) ResourcePlural() string {
return ResourcePluralEtcdVersion
}
func (p EtcdVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crdutils.NewCustomResourceDefinition(crdutils.Config{
Group: SchemeGroupVersion.Group,
Plural: ResourcePluralEtcdVersion,
Singular: ResourceSingularEtcdVersion,
Kind: ResourceKindEtcdVersion,
ShortNames: []string{ResourceCodeEtcdVersion},
Categories: []string{"datastore", "kubedb", "appscode"},
ResourceScope: string(apiextensions.ClusterScoped),
Versions: []apiextensions.CustomResourceDefinitionVersion{
{
Name: SchemeGroupVersion.Version,
Served: true,
Storage: true,
},
},
Labels: crdutils.Labels{
LabelsMap: map[string]string{"app": "kubedb"},
},
SpecDefinitionName: "kubedb.dev/apimachinery/apis/catalog/v1alpha1.EtcdVersion",
EnableValidation: true,
GetOpenAPIDefinitions: GetOpenAPIDefinitions,
EnableStatusSubresource: false,
AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{
{
Name: "Version",
Type: "string",
JSONPath: ".spec.version",
},
{
Name: "DB_IMAGE",
Type: "string",
JSONPath: ".spec.db.image",
},
{
Name: "Deprecated",
Type: "boolean",
JSONPath: ".spec.deprecated",
},
{
Name: "Age",
Type: "date",
JSONPath: ".metadata.creationTimestamp",
},
},
})
}
You can’t perform that action at this time.