From b27b6ea2a8071b9ac2fa8695f4e523c05376446e Mon Sep 17 00:00:00 2001 From: Abhi Kapoor <43758739+abhi-kapoor@users.noreply.github.com> Date: Wed, 14 Jul 2021 17:17:09 -0400 Subject: [PATCH] Add shortNames to CRDs(#693) Add `shortNames` to kube api-resource CRDs. Short-names make it easier when interacting/troubleshooting api-resources with kubectl. We have tried to follow the naming convention similar to what K8s uses which should help with avoiding any naming conflicts as well. For example: * `Deployment` has a shortName of deploy, so added rdeploy for `runnerdeployment` * `HorizontalPodAutoscaler` has a shortName of hpa, so added hra for `HorizontalRunnerAutoscaler` * `ReplicaSets` has a shortName of rs, so added rrs for `runnerreplicaset` Co-authored-by: abhinav454 <43758739+abhinav454@users.noreply.github.com> --- api/v1alpha1/horizontalrunnerautoscaler_types.go | 1 + api/v1alpha1/runnerdeployment_types.go | 1 + api/v1alpha1/runnerreplicaset_types.go | 1 + .../actions.summerwind.dev_horizontalrunnerautoscalers.yaml | 2 ++ .../crds/actions.summerwind.dev_runnerdeployments.yaml | 2 ++ .../crds/actions.summerwind.dev_runnerreplicasets.yaml | 2 ++ .../actions.summerwind.dev_horizontalrunnerautoscalers.yaml | 2 ++ config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml | 2 ++ config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml | 2 ++ 9 files changed, 15 insertions(+) diff --git a/api/v1alpha1/horizontalrunnerautoscaler_types.go b/api/v1alpha1/horizontalrunnerautoscaler_types.go index 23596d11..f4ccb4ca 100644 --- a/api/v1alpha1/horizontalrunnerautoscaler_types.go +++ b/api/v1alpha1/horizontalrunnerautoscaler_types.go @@ -223,6 +223,7 @@ type CacheEntry struct { } // +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=hra // +kubebuilder:subresource:status // +kubebuilder:printcolumn:JSONPath=".spec.minReplicas",name=Min,type=number // +kubebuilder:printcolumn:JSONPath=".spec.maxReplicas",name=Max,type=number diff --git a/api/v1alpha1/runnerdeployment_types.go b/api/v1alpha1/runnerdeployment_types.go index dfca3e79..23b0d0d2 100644 --- a/api/v1alpha1/runnerdeployment_types.go +++ b/api/v1alpha1/runnerdeployment_types.go @@ -67,6 +67,7 @@ type RunnerDeploymentStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=rdeploy // +kubebuilder:subresource:status // +kubebuilder:printcolumn:JSONPath=".spec.replicas",name=Desired,type=number // +kubebuilder:printcolumn:JSONPath=".status.replicas",name=Current,type=number diff --git a/api/v1alpha1/runnerreplicaset_types.go b/api/v1alpha1/runnerreplicaset_types.go index cbad9c96..4c698feb 100644 --- a/api/v1alpha1/runnerreplicaset_types.go +++ b/api/v1alpha1/runnerreplicaset_types.go @@ -55,6 +55,7 @@ type RunnerTemplate struct { } // +kubebuilder:object:root=true +// +kubebuilder:resource:shortName=rrs // +kubebuilder:subresource:status // +kubebuilder:printcolumn:JSONPath=".spec.replicas",name=Desired,type=number // +kubebuilder:printcolumn:JSONPath=".status.replicas",name=Current,type=number diff --git a/charts/actions-runner-controller/crds/actions.summerwind.dev_horizontalrunnerautoscalers.yaml b/charts/actions-runner-controller/crds/actions.summerwind.dev_horizontalrunnerautoscalers.yaml index 10c0d144..198b1ea3 100644 --- a/charts/actions-runner-controller/crds/actions.summerwind.dev_horizontalrunnerautoscalers.yaml +++ b/charts/actions-runner-controller/crds/actions.summerwind.dev_horizontalrunnerautoscalers.yaml @@ -13,6 +13,8 @@ spec: kind: HorizontalRunnerAutoscaler listKind: HorizontalRunnerAutoscalerList plural: horizontalrunnerautoscalers + shortNames: + - hra singular: horizontalrunnerautoscaler scope: Namespaced versions: diff --git a/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml b/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml index 317c11c8..763818d7 100644 --- a/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml +++ b/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerdeployments.yaml @@ -11,6 +11,8 @@ spec: kind: RunnerDeployment listKind: RunnerDeploymentList plural: runnerdeployments + shortNames: + - rdeploy singular: runnerdeployment scope: Namespaced versions: diff --git a/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerreplicasets.yaml b/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerreplicasets.yaml index 6c8feb7d..53a36145 100644 --- a/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerreplicasets.yaml +++ b/charts/actions-runner-controller/crds/actions.summerwind.dev_runnerreplicasets.yaml @@ -11,6 +11,8 @@ spec: kind: RunnerReplicaSet listKind: RunnerReplicaSetList plural: runnerreplicasets + shortNames: + - rrs singular: runnerreplicaset scope: Namespaced versions: diff --git a/config/crd/bases/actions.summerwind.dev_horizontalrunnerautoscalers.yaml b/config/crd/bases/actions.summerwind.dev_horizontalrunnerautoscalers.yaml index 10c0d144..198b1ea3 100644 --- a/config/crd/bases/actions.summerwind.dev_horizontalrunnerautoscalers.yaml +++ b/config/crd/bases/actions.summerwind.dev_horizontalrunnerautoscalers.yaml @@ -13,6 +13,8 @@ spec: kind: HorizontalRunnerAutoscaler listKind: HorizontalRunnerAutoscalerList plural: horizontalrunnerautoscalers + shortNames: + - hra singular: horizontalrunnerautoscaler scope: Namespaced versions: diff --git a/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml b/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml index 317c11c8..763818d7 100644 --- a/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml +++ b/config/crd/bases/actions.summerwind.dev_runnerdeployments.yaml @@ -11,6 +11,8 @@ spec: kind: RunnerDeployment listKind: RunnerDeploymentList plural: runnerdeployments + shortNames: + - rdeploy singular: runnerdeployment scope: Namespaced versions: diff --git a/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml b/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml index 6c8feb7d..53a36145 100644 --- a/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml +++ b/config/crd/bases/actions.summerwind.dev_runnerreplicasets.yaml @@ -11,6 +11,8 @@ spec: kind: RunnerReplicaSet listKind: RunnerReplicaSetList plural: runnerreplicasets + shortNames: + - rrs singular: runnerreplicaset scope: Namespaced versions: