Skip to content

feat!: extract provisioner tags from coder_workspace_tags data source #15578

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 20 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup and error handling
  • Loading branch information
johnstcn committed Nov 22, 2024
commit 58fae9718fecc60005e3d306338db834ee77a83b
8 changes: 6 additions & 2 deletions cli/templatepush.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ func createValidTemplateVersion(inv *serpent.Invocation, args createValidTemplat
return nil, err
}
var tagsJSON strings.Builder
_ = json.NewEncoder(&tagsJSON).Encode(version.Job.Tags)
if err := json.NewEncoder(&tagsJSON).Encode(version.Job.Tags); err != nil {
// Fall back to the less-pretty string representation.
tagsJSON.Reset()
_, _ = tagsJSON.WriteString(fmt.Sprintf("%v", version.Job.Tags))
}
if version.MatchedProvisioners.Count == 0 {
cliui.Warnf(inv.Stderr, `No provisioners are available to handle the job!
Please contact your deployment administrator for assistance.
Expand All @@ -433,7 +437,7 @@ Details:
Provisioner Job ID : %s
Requested tags : %s
Most Recently Seen : %s
`, version.Job.ID, tagsJSON.String(), version.MatchedProvisioners.MostRecentlySeen.Time)
`, version.Job.ID, strings.TrimSpace(tagsJSON.String()), version.MatchedProvisioners.MostRecentlySeen.Time)
}

err = cliui.ProvisionerJob(inv.Context(), inv.Stdout, cliui.ProvisionerJobOptions{
Expand Down
Loading