From 0ff8fbd49d3a23f607936d96a3c2abc12e88be3d Mon Sep 17 00:00:00 2001 From: Scott Macfarlane Date: Mon, 9 May 2022 15:33:05 -0700 Subject: [PATCH 1/3] Support releases-api returned content-type Signed-off-by: Scott Macfarlane --- internal/releasesjson/releases.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/releasesjson/releases.go b/internal/releasesjson/releases.go index 24e32ff..849f16a 100644 --- a/internal/releasesjson/releases.go +++ b/internal/releasesjson/releases.go @@ -79,7 +79,7 @@ func (r *Releases) ListProductVersions(ctx context.Context, productName string) } contentType := resp.Header.Get("content-type") - if contentType != "application/json" { + if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" { return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) } @@ -144,7 +144,7 @@ func (r *Releases) GetProductVersion(ctx context.Context, product string, versio } contentType := resp.Header.Get("content-type") - if contentType != "application/json" { + if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" { return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) } From 9bde5b25a4d91c156e88474c664b13a0134bedc1 Mon Sep 17 00:00:00 2001 From: Scott Macfarlane Date: Mon, 9 May 2022 16:15:14 -0700 Subject: [PATCH 2/3] Set Go to v1.18 when building consul from source Signed-off-by: Scott Macfarlane --- product/consul.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product/consul.go b/product/consul.go index b619d89..73482bc 100644 --- a/product/consul.go +++ b/product/consul.go @@ -18,6 +18,7 @@ var ( v1_16 = version.Must(version.NewVersion("1.16")) // TODO: version.MustConstraint() ? v1_16c, _ = version.NewConstraint("1.16") + v1_18 = version.Must(version.NewVersion("1.18")) ) var Consul = Product{ @@ -52,6 +53,6 @@ var Consul = Product{ BuildInstructions: &BuildInstructions{ GitRepoURL: "https://github.com/hashicorp/consul.git", PreCloneCheck: &build.GoIsInstalled{}, - Build: &build.GoBuild{Version: v1_16}, + Build: &build.GoBuild{Version: v1_18}, }, } From f803d77f4f60f373c2b9f131735598c3f3c6891f Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 10 May 2022 07:11:38 +0100 Subject: [PATCH 3/3] remove unused variables --- product/consul.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/product/consul.go b/product/consul.go index 73482bc..aeeac94 100644 --- a/product/consul.go +++ b/product/consul.go @@ -15,10 +15,7 @@ import ( var consulVersionOutputRe = regexp.MustCompile(`Consul ` + simpleVersionRe) var ( - v1_16 = version.Must(version.NewVersion("1.16")) - // TODO: version.MustConstraint() ? - v1_16c, _ = version.NewConstraint("1.16") - v1_18 = version.Must(version.NewVersion("1.18")) + v1_18 = version.Must(version.NewVersion("1.18")) ) var Consul = Product{