diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 04d2fdec650e23..1dea0953403d5c 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -633,7 +633,9 @@ export class WorkspaceStarter { spec.setWorkspaceImage(instance.workspaceImage); spec.setWorkspaceLocation(workspace.config.workspaceLocation || spec.getCheckoutLocation()); spec.setFeatureFlagsList(this.toWorkspaceFeatureFlags(featureFlags)); - spec.setTimeout(await userTimeoutPromise); + if (workspace.type === 'regular') { + spec.setTimeout(await userTimeoutPromise); + } spec.setAdmission(admissionLevel); return spec; } diff --git a/components/ws-manager/pkg/manager/status.go b/components/ws-manager/pkg/manager/status.go index 52a2b7db1f6ccc..1bdcd3840fce28 100644 --- a/components/ws-manager/pkg/manager/status.go +++ b/components/ws-manager/pkg/manager/status.go @@ -731,23 +731,27 @@ func (m *Manager) isWorkspaceTimedOut(wso workspaceObjects) (reason string, err return decide(start, m.Config.Timeouts.TotalStartup, activity) case api.WorkspacePhase_RUNNING: + var timeout util.Duration + if ctv, ok := wso.Pod.Annotations[customTimeoutAnnotation]; ok { + if ct, err := time.ParseDuration(ctv); err == nil { + timeout = util.Duration(ct) + } else { + log.WithError(err).WithField("customTimeout", ctv).WithFields(wsk8s.GetOWIFromObject(&wso.Pod.ObjectMeta)).Warn("pod had custom timeout annotation set, but could not parse its value. Defaulting to ws-manager config.") + if wso.IsWorkspaceHeadless() { + timeout = m.Config.Timeouts.HeadlessWorkspace + } else { + timeout = m.Config.Timeouts.RegularWorkspace + } + } + } if wso.IsWorkspaceHeadless() { - return decide(start, m.Config.Timeouts.HeadlessWorkspace, activityRunningHeadless) + return decide(start, timeout, activityRunningHeadless) } else if lastActivity == nil { // the workspace is up and running, but the user has never produced any activity return decide(start, m.Config.Timeouts.TotalStartup, activityNone) } else if isClosed { return decide(*lastActivity, m.Config.Timeouts.AfterClose, activityClosed) } - timeout := m.Config.Timeouts.RegularWorkspace - if ctv, ok := wso.Pod.Annotations[customTimeoutAnnotation]; ok { - if ct, err := time.ParseDuration(ctv); err != nil { - log.WithError(err).WithField("customTimeout", ctv).WithFields(wsk8s.GetOWIFromObject(&wso.Pod.ObjectMeta)).Warn("pod had custom timeout annotation set, but could not parse its value. Defaulting to ws-manager config.") - timeout = m.Config.Timeouts.RegularWorkspace - } else { - timeout = util.Duration(ct) - } - } return decide(*lastActivity, timeout, activityNone) case api.WorkspacePhase_INTERRUPTED: