Skip to content

feat: add cli support for --require-active-version #10337

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 10 commits into from
Oct 19, 2023
Merged

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Oct 19, 2023

  • Also fixes an issue where the active template version was always being used when running coder start.

fixes #7481

@sreya sreya requested a review from spikecurtis October 19, 2023 05:27
@sreya sreya requested a review from spikecurtis October 19, 2023 07:43
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

LGTM, with a few suggestions/FYIs inline. I don't need to review again before merge

build, err = client.CreateWorkspaceBuild(ctx, workspace.ID, req)
// It's possible for a workspace build to fail due to the template requiring starting
// workspaces with the active version.
if cerr, ok := codersdk.AsError(err); ok && cerr.StatusCode() == http.StatusUnauthorized {
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops. This should have been 403 Forbidden, not 401 Unauthorized. Despite the name, 401 is for when we failed to authenticate the user. Probably shouldn't change it now, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that's fair I'll update it in a separate PR

@sreya sreya merged commit f5f150d into main Oct 19, 2023
@sreya sreya deleted the jon/activeversioncli branch October 19, 2023 22:16
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 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.

CLI commands to enable/disable template version selection
2 participants