forked from vmware-archive/octant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List additional columns in Custom Resource view
Custom Resource Definitions may additionalPrinterColumns that are specific to a give api version. The CustomResourceHandler and CustomResourceListHandler were only handling top-level additionalPrinterColumns that apply to all columns regardless of version. This change handles version-specific additionalPrinterColumns. This change addresses vmware-archive#405 Signed-off-by: Gary Smith <garysmith123@gmail.com>
- Loading branch information
Showing
4 changed files
with
174 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: "stable.example.com/v2" | ||
kind: Version | ||
metadata: | ||
name: my-version | ||
spec: | ||
cronSpec: "* * * * */9" | ||
replicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: versions.stable.example.com | ||
spec: | ||
group: stable.example.com | ||
scope: Namespaced | ||
names: | ||
plural: versions | ||
singular: version | ||
kind: Version | ||
shortNames: | ||
- ver | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
cronSpec: | ||
type: string | ||
image: | ||
type: string | ||
replicas: | ||
type: integer | ||
additionalPrinterColumns: | ||
- name: Spec | ||
type: string | ||
description: The cron spec defining the interval a CronJob is run | ||
jsonPath: .spec.cronSpec | ||
- name: Replicas | ||
type: integer | ||
description: The number of jobs launched by the CronJob | ||
jsonPath: .spec.replicas | ||
- name: Age | ||
type: date | ||
jsonPath: .metadata.creationTimestamp | ||
- name: v2 | ||
served: true | ||
storage: false | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
cronSpec: | ||
type: string | ||
replicas: | ||
type: integer | ||
additionalPrinterColumns: | ||
- name: Spec | ||
type: string | ||
description: The cron spec defining the interval a CronJob is run | ||
jsonPath: .spec.cronSpec | ||
- name: Count | ||
type: integer | ||
description: The number of jobs launched by the CronJob | ||
jsonPath: .spec.replicas |