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>
This commit is contained in:
Abhi Kapoor 2021-07-14 17:17:09 -04:00 committed by GitHub
parent f858e2e432
commit b27b6ea2a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -13,6 +13,8 @@ spec:
kind: HorizontalRunnerAutoscaler
listKind: HorizontalRunnerAutoscalerList
plural: horizontalrunnerautoscalers
shortNames:
- hra
singular: horizontalrunnerautoscaler
scope: Namespaced
versions:

View File

@ -11,6 +11,8 @@ spec:
kind: RunnerDeployment
listKind: RunnerDeploymentList
plural: runnerdeployments
shortNames:
- rdeploy
singular: runnerdeployment
scope: Namespaced
versions:

View File

@ -11,6 +11,8 @@ spec:
kind: RunnerReplicaSet
listKind: RunnerReplicaSetList
plural: runnerreplicasets
shortNames:
- rrs
singular: runnerreplicaset
scope: Namespaced
versions:

View File

@ -13,6 +13,8 @@ spec:
kind: HorizontalRunnerAutoscaler
listKind: HorizontalRunnerAutoscalerList
plural: horizontalrunnerautoscalers
shortNames:
- hra
singular: horizontalrunnerautoscaler
scope: Namespaced
versions:

View File

@ -11,6 +11,8 @@ spec:
kind: RunnerDeployment
listKind: RunnerDeploymentList
plural: runnerdeployments
shortNames:
- rdeploy
singular: runnerdeployment
scope: Namespaced
versions:

View File

@ -11,6 +11,8 @@ spec:
kind: RunnerReplicaSet
listKind: RunnerReplicaSetList
plural: runnerreplicasets
shortNames:
- rrs
singular: runnerreplicaset
scope: Namespaced
versions: