fix(cli): handle version mismatch re MatchedProvisioners response (#15682)

* Modifies `MatchedProvisioners` response of `codersdk.TemplateVersion`
to be a pointer
* CLI now checks for absence of `*MatchedProvisioners` before showing
warning regarding provisioners
* Extracts logic for warning about provisioners to a function
* Improves test coverage for CLI template push with
`coder_workspace_tags`.
This commit is contained in:
Cian Johnston
2024-11-29 19:45:58 +00:00
committed by GitHub
parent 0b4eb8bafc
commit 3014713c47
6 changed files with 199 additions and 107 deletions
+1
View File
@@ -53,6 +53,7 @@ type ProvisionerDaemon struct {
// MatchedProvisioners represents the number of provisioner daemons
// available to take a job at a specific point in time.
// Introduced in Coder version 2.18.0.
type MatchedProvisioners struct {
// Count is the number of provisioner daemons that matched the given
// tags. If the count is 0, it means no provisioner daemons matched the
+1 -1
View File
@@ -32,7 +32,7 @@ type TemplateVersion struct {
Archived bool `json:"archived"`
Warnings []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"`
MatchedProvisioners MatchedProvisioners `json:"matched_provisioners,omitempty"`
MatchedProvisioners *MatchedProvisioners `json:"matched_provisioners,omitempty"`
}
type TemplateVersionExternalAuth struct {