Skip to content

Commit

Permalink
generate CRD shortnames
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
Zbynek Roubalik authored and zroubalik committed Apr 29, 2020
1 parent e38f390 commit ccd01cf
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
15 changes: 15 additions & 0 deletions deploy/crds/keda.sh_scaledjobs_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@ kind: CustomResourceDefinition
metadata:
name: scaledjobs.keda.sh
spec:
additionalPrinterColumns:
- JSONPath: .spec.triggers[*].type
name: Triggers
type: string
- JSONPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- JSONPath: .status.conditions[?(@.type=="Active")].status
name: Active
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: keda.sh
names:
kind: ScaledJob
listKind: ScaledJobList
plural: scaledjobs
shortNames:
- sj
singular: scaledjob
scope: Namespaced
subresources:
Expand Down
2 changes: 2 additions & 0 deletions deploy/crds/keda.sh_scaledobjects_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
kind: ScaledObject
listKind: ScaledObjectList
plural: scaledobjects
shortNames:
- so
singular: scaledobject
scope: Namespaced
subresources:
Expand Down
3 changes: 3 additions & 0 deletions deploy/crds/keda.sh_triggerauthentications_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ spec:
kind: TriggerAuthentication
listKind: TriggerAuthenticationList
plural: triggerauthentications
shortNames:
- ta
- triggerauth
singular: triggerauthentication
scope: Namespaced
validation:
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/keda/v1alpha1/scaledjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// ScaledJob is the Schema for the scaledjobs API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=scaledobjects,scope=Namespaced
// +kubebuilder:resource:path=scaledjobs,scope=Namespaced,shortName=sj
// +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status"
// +kubebuilder:printcolumn:name="Active",type="string",JSONPath=".status.conditions[?(@.type==\"Active\")].status"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/keda/v1alpha1/scaledobject_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// ScaledObject is a specification for a ScaledObject resource
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=scaledobjects,scope=Namespaced
// +kubebuilder:resource:path=scaledobjects,scope=Namespaced,shortName=so
// +kubebuilder:printcolumn:name="ScaleTargetKind",type="string",JSONPath=".status.scaleTargetKind"
// +kubebuilder:printcolumn:name="ScaleTargetName",type="string",JSONPath=".spec.scaleTargetRef.name"
// +kubebuilder:printcolumn:name="Triggers",type="string",JSONPath=".spec.triggers[*].type"
Expand Down
26 changes: 13 additions & 13 deletions pkg/apis/keda/v1alpha1/triggerauthentication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// TriggerAuthentication defines how a trigger can authenticate
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:path=triggerauthentications,scope=Namespaced,shortName=ta;triggerauth
type TriggerAuthentication struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec TriggerAuthenticationSpec `json:"spec"`
}

// TriggerAuthenticationSpec defines the various ways to authenticate
// +k8s:openapi-gen=true
type TriggerAuthenticationSpec struct {
Expand All @@ -19,19 +32,6 @@ type TriggerAuthenticationSpec struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// TriggerAuthentication defines how a trigger can authenticate
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:resource:path=triggerauthentications,scope=Namespaced
type TriggerAuthentication struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec TriggerAuthenticationSpec `json:"spec"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// TriggerAuthenticationList contains a list of TriggerAuthentication
type TriggerAuthenticationList struct {
metav1.TypeMeta `json:",inline"`
Expand Down

0 comments on commit ccd01cf

Please sign in to comment.