- Notifications
You must be signed in to change notification settings - Fork1.1k
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
944eb3a7bc2fc84653638fc8ff5685c2c8f2e9526b01c8e995a53d86c1e321ded534bd42f39a7c6f33f7b22e890a8a620f8ec672c7b7aa4080dc6c2563157758fae9790991bdFile 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.