Skip to content

Commit

Permalink
feat: add an extra printer column for the kubectl output (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
givanov authored Feb 7, 2020
1 parent 25988f9 commit 81d42dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ generate: setup
-p ./pkg/apis/credstash/v1alpha1 \
-h ./hack/boilerplate.go.txt -r "-"
@go generate ./...
@cp deploy/crds/credstash.ouzi.tech_credstashsecrets_crd.yaml deploy/helm/credstash-operator/crds/crds.yaml

CHART_NAME ?= credstash-operator
CHART_VERSION ?= 0.0.0
Expand Down
5 changes: 5 additions & 0 deletions deploy/crds/credstash.ouzi.tech_credstashsecrets_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: CustomResourceDefinition
metadata:
name: credstashsecrets.credstash.ouzi.tech
spec:
additionalPrinterColumns:
- JSONPath: .status.name
description: The managed secret
name: Secret
type: string
group: credstash.ouzi.tech
names:
kind: CredstashSecret
Expand Down
13 changes: 10 additions & 3 deletions deploy/helm/credstash-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: CustomResourceDefinition
metadata:
name: credstashsecrets.credstash.ouzi.tech
spec:
additionalPrinterColumns:
- JSONPath: .status.name
description: The managed secret
name: Secret
type: string
group: credstash.ouzi.tech
names:
kind: CredstashSecret
Expand Down Expand Up @@ -38,6 +43,8 @@ spec:
properties:
key:
type: string
name:
type: string
table:
type: string
version:
Expand All @@ -54,6 +61,6 @@ spec:
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
- name: v1alpha1
served: true
storage: true
1 change: 1 addition & 0 deletions pkg/apis/credstash/v1alpha1/credstashsecret_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type CredstashSecretStatus struct {
// CredstashSecret is the Schema for the credstashsecrets API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=credstashsecrets,scope=Namespaced
// +kubebuilder:printcolumn:name="Secret",type="string",JSONPath=".status.name",description="The managed secret"
type CredstashSecret struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down

0 comments on commit 81d42dd

Please sign in to comment.