- Notifications
You must be signed in to change notification settings - Fork917
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
944eb3a
7bc2fc8
4653638
fc8ff56
85c2c8f
2e9526b
01c8e99
5a53d86
c1e321d
ed534bd
42f39a7
c6f33f7
b22e890
a8a620f
8ec672c
7b7aa40
80dc6c2
5631577
58fae97
90991bd
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,6 +2,7 @@ package cli | ||
import ( | ||
"bufio" | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"io" | ||
@@ -415,6 +416,29 @@ func createValidTemplateVersion(inv *serpent.Invocation, args createValidTemplat | ||
if err != nil { | ||
return nil, err | ||
} | ||
var tagsJSON strings.Builder | ||
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. | ||
Details: | ||
Provisioner job ID : %s | ||
Requested tags : %s | ||
`, version.Job.ID, tagsJSON.String()) | ||
} else if version.MatchedProvisioners.Available == 0 { | ||
cliui.Warnf(inv.Stderr, `All available provisioner daemons have been silent for a while. | ||
Your build will proceed once they become available. | ||
If this persists, please contact your deployment administrator for assistance. | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Details: | ||
Provisioner job ID : %s | ||
Requested tags : %s | ||
Most recently seen : %s | ||
`, version.Job.ID, strings.TrimSpace(tagsJSON.String()), version.MatchedProvisioners.MostRecentlySeen.Time) | ||
} | ||
err = cliui.ProvisionerJob(inv.Context(), inv.Stdout, cliui.ProvisionerJobOptions{ | ||
Fetch: func() (codersdk.ProvisionerJob, error) { | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.