Skip to content

Commit 19eca50

Browse files
yehudit1987Yehudit Kerido
andauthored
feat(ws): add pendingRestart field to workspace model (#230)
Signed-off-by: Yehudit Kerido <[email protected]> Co-authored-by: Yehudit Kerido <[email protected]>
1 parent 9e023c2 commit 19eca50

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

workspaces/backend/internal/models/workspaces/funcs.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ func NewWorkspaceModelFromWorkspace(ws *kubefloworgv1beta1.Workspace, wsk *kubef
101101
Icon: iconRef,
102102
Logo: logoRef,
103103
},
104-
DeferUpdates: ptr.Deref(ws.Spec.DeferUpdates, false),
105-
Paused: ptr.Deref(ws.Spec.Paused, false),
106-
PausedTime: ws.Status.PauseTime,
107-
State: wsState,
108-
StateMessage: ws.Status.StateMessage,
104+
DeferUpdates: ptr.Deref(ws.Spec.DeferUpdates, false),
105+
Paused: ptr.Deref(ws.Spec.Paused, false),
106+
PausedTime: ws.Status.PauseTime,
107+
PendingRestart: ws.Status.PendingRestart,
108+
State: wsState,
109+
StateMessage: ws.Status.StateMessage,
109110
PodTemplate: PodTemplate{
110111
PodMetadata: PodMetadata{
111112
Labels: podLabels,

workspaces/backend/internal/models/workspaces/types.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ package workspaces
1919
// Workspace represents a workspace in the system, and is returned by GET and LIST operations.
2020
// NOTE: this type is not used for CREATE or UPDATE operations, see WorkspaceCreate
2121
type Workspace struct {
22-
Name string `json:"name"`
23-
Namespace string `json:"namespace"`
24-
WorkspaceKind WorkspaceKindInfo `json:"workspaceKind"`
25-
DeferUpdates bool `json:"deferUpdates"`
26-
Paused bool `json:"paused"`
27-
PausedTime int64 `json:"pausedTime"`
28-
State WorkspaceState `json:"state"`
29-
StateMessage string `json:"stateMessage"`
30-
PodTemplate PodTemplate `json:"podTemplate"`
31-
Activity Activity `json:"activity"`
32-
Services []Service `json:"services"`
22+
Name string `json:"name"`
23+
Namespace string `json:"namespace"`
24+
WorkspaceKind WorkspaceKindInfo `json:"workspaceKind"`
25+
DeferUpdates bool `json:"deferUpdates"`
26+
Paused bool `json:"paused"`
27+
PausedTime int64 `json:"pausedTime"`
28+
PendingRestart bool `json:"pendingRestart"`
29+
State WorkspaceState `json:"state"`
30+
StateMessage string `json:"stateMessage"`
31+
PodTemplate PodTemplate `json:"podTemplate"`
32+
Activity Activity `json:"activity"`
33+
Services []Service `json:"services"`
3334
}
3435

3536
type WorkspaceState string

0 commit comments

Comments
 (0)