Skip to content

Commit

Permalink
feat: add shortName and extra cols to crds
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Steiner <jakob.steiner@glasskube.eu>
  • Loading branch information
kosmoz committed Feb 19, 2024
1 parent 8c56780 commit ab439c9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion api/v1alpha1/package_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ type PackageStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:resource:scope=Cluster,shortName=pkg
//+kubebuilder:printcolumn:name=Desired version,type=string,JSONPath=".spec.packageInfo.version"
//+kubebuilder:printcolumn:name=Installed version,type=string,JSONPath=".status.version"

// Package is the Schema for the packages API
type Package struct {
Expand Down
5 changes: 4 additions & 1 deletion api/v1alpha1/packageinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ type PackageInfoStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:path=packageinfos,scope=Cluster
//+kubebuilder:resource:path=packageinfos,scope=Cluster,shortName=pkgi
//+kubebuilder:printcolumn:name=Desired version,type=string,JSONPath=".spec.version"
//+kubebuilder:printcolumn:name=Current version,type=string,JSONPath=".status.version"
//+kubebuilder:printcolumn:name="Last Updated",type=date,JSONPath=".status.lastUpdateTimestamp"

// PackageInfo is the Schema for the packageinfos API
type PackageInfo struct {
Expand Down
14 changes: 13 additions & 1 deletion config/crd/bases/packages.glasskube.dev_packageinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ spec:
kind: PackageInfo
listKind: PackageInfoList
plural: packageinfos
shortNames:
- pkgi
singular: packageinfo
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.version
name: Desired version
type: string
- jsonPath: .status.version
name: Current version
type: string
- jsonPath: .status.lastUpdateTimestamp
name: Last Updated
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: PackageInfo is the Schema for the packageinfos API
Expand Down
11 changes: 10 additions & 1 deletion config/crd/bases/packages.glasskube.dev_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ spec:
kind: Package
listKind: PackageList
plural: packages
shortNames:
- pkg
singular: package
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .spec.packageInfo.version
name: Desired version
type: string
- jsonPath: .status.version
name: Installed version
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Package is the Schema for the packages API
Expand Down

0 comments on commit ab439c9

Please sign in to comment.