Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add short name and some other mark for crds #75

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading