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.95 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 = &MySQLVersion{}
func (p MySQLVersion) ResourceShortCode() string {
return ResourceCodeMySQLVersion
}
func (p MySQLVersion) ResourceKind() string {
return ResourceKindMySQLVersion
}
func (p MySQLVersion) ResourceSingular() string {
return ResourceSingularMySQLVersion
}
func (p MySQLVersion) ResourcePlural() string {
return ResourcePluralMySQLVersion
}
func (p MySQLVersion) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crdutils.NewCustomResourceDefinition(crdutils.Config{
Group: SchemeGroupVersion.Group,
Plural: ResourcePluralMySQLVersion,
Singular: ResourceSingularMySQLVersion,
Kind: ResourceKindMySQLVersion,
ShortNames: []string{ResourceCodeMySQLVersion},
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.MySQLVersion",
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.