Skip to content

Commit

Permalink
[EPMDEDP-12184]: chore: Add printcolumn in CRs for better UX
Browse files Browse the repository at this point in the history
Enrich kubectl get output for EDP CRs

Signed-off-by: Sergiy Kulanov <sergiy_kulanov@epam.com>
Change-Id: If3a794d697f16c52017a3726567777c2bee9983d
  • Loading branch information
SergK committed Jul 4, 2023
1 parent 6de2d77 commit 1d896e0
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/v1/codebase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ type CodebaseStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=cdbs
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type",description="Codebase type"
// +kubebuilder:printcolumn:name="Available",type="boolean",JSONPath=".status.available",description="Is resource available"
// +kubebuilder:printcolumn:name="Result",type="string",JSONPath=".status.result",description="Result of last action"
// +kubebuilder:printcolumn:name="Default Branch",type="string",JSONPath=".spec.defaultBranch",description="Default Branch"
// +kubebuilder:printcolumn:name="GitWebUrl",type="string",JSONPath=".status.gitWebUrl",description="Repository Web URL"

// Codebase is the Schema for the Codebases API.
type Codebase struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1/codebasebranch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type CodebaseBranchStatus struct {
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Result",type="string",JSONPath=".status.result",description="Result of last action"
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status",description="The status of codebasebranch"
// +kubebuilder:printcolumn:name="Codebase Name",type="string",JSONPath=".spec.codebaseName",description="Owner of object"
// +kubebuilder:printcolumn:name="Release",type="boolean",JSONPath=".spec.release",description="Is a release branch"

// CodebaseBranch is the Schema for the CodebaseBranches API.
type CodebaseBranch struct {
Expand Down
1 change: 1 addition & 0 deletions api/v1/codebaseimagestream_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type CodebaseImageStreamStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=cbis
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Codebase Name",type="string",JSONPath=".spec.codebase",description="Owner of object"

// CodebaseImageStream is the Schema for the CodebaseImageStreams API.
type CodebaseImageStream struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1/git_server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ type GitServerStatus struct {
// +kubebuilder:resource:shortName=gs
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Available",type="boolean",JSONPath=".status.available",description="Is resource available"
// +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".spec.gitHost",description="GitSever host"
// +kubebuilder:printcolumn:name="Git Provider",type="string",JSONPath=".spec.gitProvider",description="Git Provider type"

// GitServer is the Schema for the gitservers API.
type GitServer struct {
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/v2.edp.epam.com_codebasebranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ spec:
jsonPath: .status.status
name: Status
type: string
- description: Owner of object
jsonPath: .spec.codebaseName
name: Codebase Name
type: string
- description: Is a release branch
jsonPath: .spec.release
name: Release
type: boolean
name: v1
schema:
openAPIV3Schema:
Expand Down
7 changes: 6 additions & 1 deletion config/crd/bases/v2.edp.epam.com_codebaseimagestreams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ spec:
singular: codebaseimagestream
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- description: Owner of object
jsonPath: .spec.codebase
name: Codebase Name
type: string
name: v1
schema:
openAPIV3Schema:
description: CodebaseImageStream is the Schema for the CodebaseImageStreams
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/v2.edp.epam.com_codebases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Codebase type
jsonPath: .spec.type
name: Type
type: string
- description: Is resource available
jsonPath: .status.available
name: Available
Expand All @@ -26,6 +30,14 @@ spec:
jsonPath: .status.result
name: Result
type: string
- description: Default Branch
jsonPath: .spec.defaultBranch
name: Default Branch
type: string
- description: Repository Web URL
jsonPath: .status.gitWebUrl
name: GitWebUrl
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/v2.edp.epam.com_gitservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ spec:
jsonPath: .status.available
name: Available
type: boolean
- description: GitSever host
jsonPath: .spec.gitHost
name: Host
type: string
- description: Git Provider type
jsonPath: .spec.gitProvider
name: Git Provider
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down
8 changes: 8 additions & 0 deletions deploy-templates/crds/v2.edp.epam.com_codebasebranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ spec:
jsonPath: .status.status
name: Status
type: string
- description: Owner of object
jsonPath: .spec.codebaseName
name: Codebase Name
type: string
- description: Is a release branch
jsonPath: .spec.release
name: Release
type: boolean
name: v1
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ spec:
singular: codebaseimagestream
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- description: Owner of object
jsonPath: .spec.codebase
name: Codebase Name
type: string
name: v1
schema:
openAPIV3Schema:
description: CodebaseImageStream is the Schema for the CodebaseImageStreams
Expand Down
12 changes: 12 additions & 0 deletions deploy-templates/crds/v2.edp.epam.com_codebases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Codebase type
jsonPath: .spec.type
name: Type
type: string
- description: Is resource available
jsonPath: .status.available
name: Available
Expand All @@ -26,6 +30,14 @@ spec:
jsonPath: .status.result
name: Result
type: string
- description: Default Branch
jsonPath: .spec.defaultBranch
name: Default Branch
type: string
- description: Repository Web URL
jsonPath: .status.gitWebUrl
name: GitWebUrl
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down
8 changes: 8 additions & 0 deletions deploy-templates/crds/v2.edp.epam.com_gitservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ spec:
jsonPath: .status.available
name: Available
type: boolean
- description: GitSever host
jsonPath: .spec.gitHost
name: Host
type: string
- description: Git Provider type
jsonPath: .spec.gitProvider
name: Git Provider
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down

0 comments on commit 1d896e0

Please sign in to comment.