Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Add display columns for appcatalogentry CRD (#593)
Browse files Browse the repository at this point in the history
* Add display columns

* Add changelog

* Fix jsonpath for catalog
  • Loading branch information
rossf7 authored Oct 23, 2020
1 parent 0818a38 commit 559cfda
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 49 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add display columns to `AppCatalogEntry` CRD.

## [3.2.0] - 2020-10-15

### Added
Expand Down
24 changes: 23 additions & 1 deletion config/crd/v1/application.giantswarm.io_appcatalogentries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,28 @@ spec:
singular: appcatalogentry
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Catalog this entry belongs to
jsonPath: .spec.catalog.name
name: Catalog
type: string
- description: App this entry belongs to
jsonPath: .spec.appName
name: App Name
type: string
- description: Upstream version of the app for this entry
jsonPath: .spec.appVersion
name: App Version
type: string
- description: Version of the app for this entry
jsonPath: .spec.version
name: Version
type: string
- description: Time since entry was first created
jsonPath: .spec.dateCreated
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: AppCatalogEntry represents an entry of an app in a catalog of
Expand Down Expand Up @@ -103,6 +124,7 @@ spec:
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ metadata:
creationTimestamp: null
name: appcatalogentries.application.giantswarm.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.catalog.name
description: Catalog this entry belongs to
name: Catalog
type: string
- JSONPath: .spec.appName
description: App this entry belongs to
name: App Name
type: string
- JSONPath: .spec.appVersion
description: Upstream version of the app for this entry
name: App Version
type: string
- JSONPath: .spec.version
description: Version of the app for this entry
name: Version
type: string
- JSONPath: .spec.dateCreated
description: Time since entry was first created
name: Age
type: date
group: application.giantswarm.io
names:
categories:
Expand All @@ -18,6 +39,7 @@ spec:
plural: appcatalogentries
singular: appcatalogentry
scope: Namespaced
subresources: {}
validation:
openAPIV3Schema:
description: AppCatalogEntry represents an entry of an app in a catalog of managed
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/application/v1alpha1/app_catalog_entry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ func NewAppCatalogEntryCR() *AppCatalogEntry {
}
}

// +kubebuilder:printcolumn:name="Catalog",type=string,JSONPath=`.spec.catalog.name`,description="Catalog this entry belongs to"
// +kubebuilder:printcolumn:name="App Name",type=string,JSONPath=`.spec.appName`,description="App this entry belongs to"
// +kubebuilder:printcolumn:name="App Version",type=string,JSONPath=`.spec.appVersion`,description="Upstream version of the app for this entry"
// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`,description="Version of the app for this entry"
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.spec.dateCreated`,description="Time since entry was first created"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:categories=common;giantswarm
// +kubebuilder:storageversion
// +k8s:openapi-gen=true

// AppCatalogEntry represents an entry of an app in a catalog of managed apps.
type AppCatalogEntry struct {
metav1.TypeMeta `json:",inline"`
Expand Down
100 changes: 52 additions & 48 deletions pkg/crd/internal/zz_generated.fs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 559cfda

Please sign in to comment.