Skip to content

Commit

Permalink
Add printcolumn annotations to devworkspace to populate kubectl get
Browse files Browse the repository at this point in the history
Add kubebuilder annotations to populate kubectl get output for
devworkspaces

Signed-off-by: Angel Misevski <[email protected]>
  • Loading branch information
amisevsk committed Jun 10, 2020
1 parent 2e0dbf9 commit e6a761a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deploy/crds/workspace.devfile.io_devworkspaces_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ kind: CustomResourceDefinition
metadata:
name: devworkspaces.workspace.devfile.io
spec:
additionalPrinterColumns:
- JSONPath: .status.workspaceId
description: The workspace's unique id
name: Workspace ID
type: string
- JSONPath: .status.phase
description: The current workspace startup phase
name: Phase
type: string
- JSONPath: .status.ideUrl
description: Url endpoint for accessing workspace
name: URL
type: string
group: workspace.devfile.io
names:
kind: DevWorkspace
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/workspaces/v1alpha1/devworkspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const (
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=devworkspaces,scope=Namespaced
// +kubebuilder:printcolumn:name="Workspace ID",type="string",JSONPath=".status.workspaceId",description="The workspace's unique id"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="The current workspace startup phase"
// +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.ideUrl",description="Url endpoint for accessing workspace"
type DevWorkspace struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down

0 comments on commit e6a761a

Please sign in to comment.