Skip to content

Commit 5c5ddc6

Browse files
authored
fix(site): Hide agent lifecycle unless opted in via delay_login_until_ready (#5850)
Refs: #5835, #5749
1 parent 78ede50 commit 5c5ddc6

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

site/src/components/Resources/AgentStatus.tsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,22 +135,32 @@ const StartErrorLifecycle: React.FC<{
135135
const ConnectedStatus: React.FC<{
136136
agent: WorkspaceAgent
137137
}> = ({ agent }) => {
138-
return (
139-
<ChooseOne>
140-
<Cond condition={agent.lifecycle_state === "ready"}>
141-
<ReadyLifeCycle />
142-
</Cond>
143-
<Cond condition={agent.lifecycle_state === "start_timeout"}>
144-
<StartTimeoutLifecycle agent={agent} />
145-
</Cond>
146-
<Cond condition={agent.lifecycle_state === "start_error"}>
147-
<StartErrorLifecycle agent={agent} />
148-
</Cond>
149-
<Cond>
150-
<StartingLifecycle />
151-
</Cond>
152-
</ChooseOne>
153-
)
138+
// NOTE(mafredri): Keep this behind feature flag for the time-being,
139+
// if delay_login_until_ready is true, the user has updated to
140+
// terraform-provider-coder v0.6.7 and opted in to the functionality.
141+
//
142+
// Remove check once documentation is in place and we do a breaking
143+
// release indicating startup script behavior has changed.
144+
// https://github.com/coder/coder/issues/5749
145+
if (agent.delay_login_until_ready) {
146+
return (
147+
<ChooseOne>
148+
<Cond condition={agent.lifecycle_state === "ready"}>
149+
<ReadyLifeCycle />
150+
</Cond>
151+
<Cond condition={agent.lifecycle_state === "start_timeout"}>
152+
<StartTimeoutLifecycle agent={agent} />
153+
</Cond>
154+
<Cond condition={agent.lifecycle_state === "start_error"}>
155+
<StartErrorLifecycle agent={agent} />
156+
</Cond>
157+
<Cond>
158+
<StartingLifecycle />
159+
</Cond>
160+
</ChooseOne>
161+
)
162+
}
163+
return <ReadyLifeCycle />
154164
}
155165

156166
const DisconnectedStatus: React.FC = () => {

0 commit comments

Comments
 (0)