Skip to content

Commit

Permalink
Merge pull request kubewarden#896 from jvanz/shortnames
Browse files Browse the repository at this point in the history
feat: shortName for the CRDs.
  • Loading branch information
jvanz authored Oct 2, 2024
2 parents 5a4df6b + 815b486 commit 436dbb4
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/policies/v1/admissionpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type AdmissionPolicySpec struct {
// AdmissionPolicy is the Schema for the admissionpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:resource:scope=Namespaced,shortName=ap
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
Expand Down
2 changes: 1 addition & 1 deletion api/policies/v1/admissionpolicygroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type AdmissionPolicyGroupSpec struct {
// AdmissionPolicyGroup is the Schema for the AdmissionPolicyGroups API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:resource:scope=Namespaced,shortName=apg
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
Expand Down
2 changes: 1 addition & 1 deletion api/policies/v1/clusteradmissionpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type ClusterAdmissionPolicySpec struct {
// ClusterAdmissionPolicy is the Schema for the clusteradmissionpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:resource:scope=Cluster,shortName=cap
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
Expand Down
2 changes: 1 addition & 1 deletion api/policies/v1/clusteradmissionpolicygroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type ClusterAdmissionPolicyGroupSpec struct {
// ClusterAdmissionPolicyGroup is the Schema for the clusteradmissionpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:resource:scope=Cluster,shortName=capg
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
Expand Down
2 changes: 1 addition & 1 deletion api/policies/v1/policyserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ type PolicyServerStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:resource:scope=Cluster,shortName=ps
//+kubebuilder:printcolumn:name="Replicas",type=string,JSONPath=`.spec.replicas`,description="Policy Server replicas"
//+kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image`,description="Policy Server image"
//+kubebuilder:storageversion
Expand Down
3 changes: 2 additions & 1 deletion api/policies/v1alpha2/admissionpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ type AdmissionPolicySpec struct {
// AdmissionPolicy is the Schema for the admissionpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:resource:scope=Namespaced,shortName=ap
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
// +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode`,description="Policy deployment mode"
// +kubebuilder:printcolumn:name="Observed mode",type=string,JSONPath=`.status.mode`,description="Policy deployment mode observed on the assigned Policy Server"
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.policyStatus`,description="Status of the policy"
// +kubebuilder:deprecatedversion:warning="This version is deprecated. Please, consider using v1"
type AdmissionPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion api/policies/v1alpha2/clusteradmissionpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ type ClusterAdmissionPolicySpec struct {
// ClusterAdmissionPolicy is the Schema for the clusteradmissionpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:resource:scope=Cluster,shortName=cap
// +kubebuilder:printcolumn:name="Policy Server",type=string,JSONPath=`.spec.policyServer`,description="Bound to Policy Server"
// +kubebuilder:printcolumn:name="Mutating",type=boolean,JSONPath=`.spec.mutating`,description="Whether the policy is mutating"
// +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.mode`,description="Policy deployment mode"
// +kubebuilder:printcolumn:name="Observed mode",type=string,JSONPath=`.status.mode`,description="Policy deployment mode observed on the assigned Policy Server"
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.policyStatus`,description="Status of the policy"
// +kubebuilder:deprecatedversion:warning="This version is deprecated. Please, consider using v1"
type ClusterAdmissionPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion api/policies/v1alpha2/policyserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ type PolicyServerStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:resource:scope=Cluster,shortName=ps
//+kubebuilder:printcolumn:name="Replicas",type=string,JSONPath=`.spec.replicas`,description="Policy Server replicas"
//+kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image`,description="Policy Server image"
// +kubebuilder:deprecatedversion:warning="This version is deprecated. Please, consider using v1"

// PolicyServer is the Schema for the policyservers API.
type PolicyServer struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
kind: AdmissionPolicy
listKind: AdmissionPolicyList
plural: admissionpolicies
shortNames:
- ap
singular: admissionpolicy
scope: Namespaced
versions:
Expand Down Expand Up @@ -474,6 +476,8 @@ spec:
jsonPath: .status.policyStatus
name: Status
type: string
deprecated: true
deprecationWarning: This version is deprecated. Please, consider using v1
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
kind: AdmissionPolicyGroup
listKind: AdmissionPolicyGroupList
plural: admissionpolicygroups
shortNames:
- apg
singular: admissionpolicygroup
scope: Namespaced
versions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
kind: ClusterAdmissionPolicy
listKind: ClusterAdmissionPolicyList
plural: clusteradmissionpolicies
shortNames:
- cap
singular: clusteradmissionpolicy
scope: Cluster
versions:
Expand Down Expand Up @@ -586,6 +588,8 @@ spec:
jsonPath: .status.policyStatus
name: Status
type: string
deprecated: true
deprecationWarning: This version is deprecated. Please, consider using v1
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
kind: ClusterAdmissionPolicyGroup
listKind: ClusterAdmissionPolicyGroupList
plural: clusteradmissionpolicygroups
shortNames:
- capg
singular: clusteradmissionpolicygroup
scope: Cluster
versions:
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/policies.kubewarden.io_policyservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
kind: PolicyServer
listKind: PolicyServerList
plural: policyservers
shortNames:
- ps
singular: policyserver
scope: Cluster
versions:
Expand Down Expand Up @@ -1719,6 +1721,8 @@ spec:
jsonPath: .spec.image
name: Image
type: string
deprecated: true
deprecationWarning: This version is deprecated. Please, consider using v1
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down

0 comments on commit 436dbb4

Please sign in to comment.