Skip to content

fix(codersdk): handle API older than client for startup script behavior #7933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 9, 2023

Regrettably, I didn't think about this case when creating the PRs for startup script behavior. If the API is older than the client, then the field may be missing. We now handle it in codersdk.

@mafredri mafredri self-assigned this Jun 9, 2023
@mafredri mafredri requested a review from johnstcn June 9, 2023 12:38
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1126,7 +1126,7 @@ func convertWorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordin
ConnectionTimeoutSeconds: dbAgent.ConnectionTimeoutSeconds,
TroubleshootingURL: troubleshootingURL,
LifecycleState: codersdk.WorkspaceAgentLifecycle(dbAgent.LifecycleState),
LoginBeforeReady: dbAgent.StartupScriptBehavior == database.StartupScriptBehaviorNonBlocking,
LoginBeforeReady: dbAgent.StartupScriptBehavior != database.StartupScriptBehaviorBlocking,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a necessary change, but this seems safer (default to old behavior) vs default to new in case something goes wrong.

@mafredri mafredri changed the title fix(codersdk): Handle API older than client for startup script behavior fix(codersdk): handle API older than client for startup script behavior Jun 9, 2023
@mafredri mafredri enabled auto-merge (squash) June 9, 2023 12:47
@mafredri mafredri merged commit e474468 into main Jun 9, 2023
@mafredri mafredri deleted the mafredri/fix-api-older-than-client branch June 9, 2023 13:01
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants