Skip to content

Commit 6f14790

Browse files
feat(ws): add podTemplatePod to Workspace status, for backend logs (#210)
* feat(ws): add `podTemplatePod` to Workspace status, for backend logs Signed-off-by: Mathew Wicks <[email protected]> * remove accidental diff Signed-off-by: Mathew Wicks <[email protected]> --------- Signed-off-by: Mathew Wicks <[email protected]>
1 parent f22890d commit 6f14790

File tree

5 files changed

+239
-72
lines changed

5 files changed

+239
-72
lines changed

workspaces/controller/api/v1beta1/workspace_types.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,12 @@ type WorkspaceStatus struct {
164164
// +kubebuilder:default=false
165165
PendingRestart bool `json:"pendingRestart"`
166166

167-
// information about the current podTemplate options
167+
// information about the current podTemplate options (only set for WorkspaceKind of podTemplate kind)
168168
PodTemplateOptions WorkspacePodOptionsStatus `json:"podTemplateOptions"`
169169

170+
// information about the Pod managed by this Workspace (only set for WorkspaceKind of podTemplate kind)
171+
PodTemplatePod WorkspacePodStatus `json:"podTemplatePod"`
172+
170173
// the current state of the Workspace
171174
// +kubebuilder:default="Unknown"
172175
State WorkspaceState `json:"state"`
@@ -221,6 +224,24 @@ type WorkspacePodOptionRedirectStep struct {
221224
Target string `json:"target"`
222225
}
223226

227+
type WorkspacePodStatus struct {
228+
// the name of the Pod resource
229+
Name string `json:"name"`
230+
231+
// information about the Pod's containers
232+
// +kubebuilder:validation:Optional
233+
Containers []WorkspacePodContainer `json:"containers,omitempty"`
234+
235+
// information about the Pod's initContainers
236+
// +kubebuilder:validation:Optional
237+
InitContainers []WorkspacePodContainer `json:"initContainers,omitempty"`
238+
}
239+
240+
type WorkspacePodContainer struct {
241+
// the name of the container
242+
Name string `json:"name"`
243+
}
244+
224245
// +kubebuilder:validation:Enum:={"Running","Terminating","Paused","Pending","Error","Unknown"}
225246
type WorkspaceState string
226247

workspaces/controller/api/v1beta1/zz_generated.deepcopy.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workspaces/controller/config/crd/bases/kubeflow.org_workspaces.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ spec:
208208
like `podMetadata`, `probes`, `extraEnv`, or `containerSecurityContext`
209209
type: boolean
210210
podTemplateOptions:
211-
description: information about the current podTemplate options
211+
description: information about the current podTemplate options (only
212+
set for WorkspaceKind of podTemplate kind)
212213
properties:
213214
imageConfig:
214215
description: info about the current imageConfig option
@@ -274,6 +275,38 @@ spec:
274275
- imageConfig
275276
- podConfig
276277
type: object
278+
podTemplatePod:
279+
description: information about the Pod managed by this Workspace (only
280+
set for WorkspaceKind of podTemplate kind)
281+
properties:
282+
containers:
283+
description: information about the Pod's containers
284+
items:
285+
properties:
286+
name:
287+
description: the name of the container
288+
type: string
289+
required:
290+
- name
291+
type: object
292+
type: array
293+
initContainers:
294+
description: information about the Pod's initContainers
295+
items:
296+
properties:
297+
name:
298+
description: the name of the container
299+
type: string
300+
required:
301+
- name
302+
type: object
303+
type: array
304+
name:
305+
description: the name of the Pod resource
306+
type: string
307+
required:
308+
- name
309+
type: object
277310
state:
278311
default: Unknown
279312
description: the current state of the Workspace
@@ -296,6 +329,7 @@ spec:
296329
- pauseTime
297330
- pendingRestart
298331
- podTemplateOptions
332+
- podTemplatePod
299333
- state
300334
- stateMessage
301335
type: object

0 commit comments

Comments
 (0)