Skip to content

Commit

Permalink
feat: add short name and some other mark for crds (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 authored Aug 2, 2024
1 parent 8723abb commit d0c6256
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
8 changes: 8 additions & 0 deletions api/v1alpha1/zookeepercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ const (
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=zookeeperclusters,scope=Namespaced,shortName=zk;zks,singular=zookeepercluster
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +operator-sdk:csv:customresourcedefinitions:displayName="Zookeeper Cluster"
// This annotation provides a hint for OLM which resources are managed by SparkHistoryServer kind.
// It's not mandatory to list all resources.
// https://sdk.operatorframework.io/docs/olm-integration/generation/#csv-fields
// https://sdk.operatorframework.io/docs/building-operators/golang/references/markers/
// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,app/v1},{Service,v1},{Pod,v1},{ConfigMap,v1},{PersistentVolumeClaim,v1},{PersistentVolume,v1},{PodDisruptionBudget,v1}}

// ZookeeperCluster is the Schema for the zookeeperclusters API
type ZookeeperCluster struct {
Expand Down
6 changes: 4 additions & 2 deletions api/v1alpha1/zookeeperznode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=zookeeperznodes,shortName=znode;znodes,singular=zookeeperznode
// +kubebuilder:subresource:status
// +operator-sdk:csv:customresourcedefinitions:displayName="Zookeeper Znode"

// ZookeeperZnode is the Schema for the zookeeperznodes API
type ZookeeperZnode struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ spec:
kind: ZookeeperCluster
listKind: ZookeeperClusterList
plural: zookeeperclusters
shortNames:
- zk
- zks
singular: zookeepercluster
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: ZookeeperCluster is the Schema for the zookeeperclusters API
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/zookeeper.zncdata.dev_zookeeperznodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ spec:
kind: ZookeeperZnode
listKind: ZookeeperZnodeList
plural: zookeeperznodes
shortNames:
- znode
- znodes
singular: zookeeperznode
scope: Namespaced
versions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ spec:
displayName: Zookeeper Cluster
kind: ZookeeperCluster
name: zookeeperclusters.zookeeper.zncdata.dev
resources:
- kind: ConfigMap
name: ""
version: v1
- kind: Deployment
name: ""
version: app/v1
- kind: PersistentVolume
name: ""
version: v1
- kind: PersistentVolumeClaim
name: ""
version: v1
- kind: Pod
name: ""
version: v1
- kind: PodDisruptionBudget
name: ""
version: v1
- kind: Service
name: ""
version: v1
version: v1alpha1
- description: ZookeeperZnode is the Schema for the zookeeperznodes API
displayName: Zookeeper Znode
Expand Down

0 comments on commit d0c6256

Please sign in to comment.