From 25feb4053eda68065646156dfa57d7687518a3ae Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 16 Aug 2019 12:00:29 +0200 Subject: [PATCH] add more columns to postgresql CRD --- .../templates/customrresourcedefinition.yaml | 18 +++++++++++--- pkg/apis/acid.zalan.do/v1/crds.go | 24 ++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/charts/postgres-operator/templates/customrresourcedefinition.yaml b/charts/postgres-operator/templates/customrresourcedefinition.yaml index 973ddd55e..9215ead9e 100644 --- a/charts/postgres-operator/templates/customrresourcedefinition.yaml +++ b/charts/postgres-operator/templates/customrresourcedefinition.yaml @@ -23,10 +23,10 @@ spec: type: string description: Team responsible for Postgres CLuster JSONPath: .spec.teamId - - name: Status + - name: Version type: string - description: Current status of Postgres cluster - JSONPath: .status.PostgresClusterStatus + description: PostgreSQL version + JSONPath: .spec.postgresql.version - name: Instances type: integer description: Number of instances per Postgres cluster @@ -35,9 +35,21 @@ spec: type: string description: Size of the bound volume JSONPath: .spec.volume.size + - name: CPU-Request + type: string + description: Requested CPU for Postgres containers + JSONPath: .spec.resources.requests.cpu + - name: Memory-Request + type: string + description: Requested memory for Postgres containers + JSONPath: .spec.resources.requests.memory - name: Age type: date JSONPath: .metadata.creationTimestamp + - name: Status + type: string + description: Current sync status of postgresql resource + JSONPath: .status.PostgresClusterStatus scope: Namespaced subresources: status: {} diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 7bdc0f558..dd9307dd4 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -28,10 +28,10 @@ var PostgresCRDResourceColumns = []apiextv1beta1.CustomResourceColumnDefinition{ JSONPath: ".spec.teamId", }, apiextv1beta1.CustomResourceColumnDefinition{ - Name: "Status", + Name: "Version", Type: "string", - Description: "Current status of Postgres cluster", - JSONPath: ".status.PostgresClusterStatus", + Description: "PostgreSQL version", + JSONPath: ".spec.postgresql.version", }, apiextv1beta1.CustomResourceColumnDefinition{ Name: "Instances", @@ -45,11 +45,29 @@ var PostgresCRDResourceColumns = []apiextv1beta1.CustomResourceColumnDefinition{ Description: "Size of the bound volume", JSONPath: ".spec.volume.size", }, + apiextv1beta1.CustomResourceColumnDefinition{ + Name: "CPU-Request", + Type: "string", + Description: "Requested CPU for Postgres containers", + JSONPath: ".spec.resources.requests.cpu", + }, + apiextv1beta1.CustomResourceColumnDefinition{ + Name: "Memory-Request", + Type: "string", + Description: "Requested memory for Postgres containers", + JSONPath: ".spec.resources.requests.memory", + }, apiextv1beta1.CustomResourceColumnDefinition{ Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp", }, + apiextv1beta1.CustomResourceColumnDefinition{ + Name: "Status", + Type: "string", + Description: "Current sync status of postgresql resource", + JSONPath: ".status.PostgresClusterStatus", + }, } // OperatorConfigCRDResourceColumns definition of AdditionalPrinterColumns for OperatorConfiguration CRD