Skip to content

Commit

Permalink
build: update hc-install to current (#24199)
Browse files Browse the repository at this point in the history
Installing Vault and Consul from releases.hashicorp.com via `hc-install` has
been failing intermittently. Update the `hc-install` binaries to be current and
add one retry to downloads for our compat tests so that we can get builds more
reliably green while the underlying issue is being debugged.
  • Loading branch information
tgross authored Oct 15, 2024
1 parent 61dd1f3 commit d261d58
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ deps: ## Install build and development dependencies
go install github.com/bufbuild/buf/cmd/[email protected]
go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest
go install golang.org/x/tools/cmd/[email protected]
go install github.com/hashicorp/hc-install/cmd/hc-install@v0.6.1
go install github.com/hashicorp/hc-install/cmd/hc-install@v0.9.0
go install github.com/shoenig/[email protected]

.PHONY: lint-deps
Expand Down
9 changes: 8 additions & 1 deletion e2e/consulcompat/shared_download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ func downloadConsulBuild(t *testing.T, b build, baseDir string) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, "hc-install", "install", "-version", b.Version, "-path", path, "consul")
cmd := exec.CommandContext(ctx, "hc-install", "install",
"-version", b.Version, "-path", path, "consul")
bs, err := cmd.CombinedOutput()
if err != nil {
t.Logf("download: failed to download %s, retrying once: %v", b.Version, err)
cmd = exec.CommandContext(ctx, "hc-install", "install",
"-version", b.Version, "-path", path, "consul")
bs, err = cmd.CombinedOutput()
}
must.NoError(t, err, must.Sprintf("failed to download consul %s: %s", b.Version, string(bs)))
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/terraform/packer/ubuntu-jammy-amd64/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sudo apt-get install -y \
apt-transport-https ca-certificates gnupg2 stress

# Install hc-install
curl -o /tmp/hc-install.zip https://releases.hashicorp.com/hc-install/0.5.2/hc-install_0.5.2_linux_amd64.zip
curl -o /tmp/hc-install.zip https://releases.hashicorp.com/hc-install/0.9.0/hc-install_0.9.0_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/hc-install.zip

# Install sockaddr
Expand Down
6 changes: 6 additions & 0 deletions e2e/vaultcompat/vaultcompat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ func downloadVaultBuild(t *testing.T, b build) {

cmd := exec.CommandContext(ctx, "hc-install", "install", "-version", b.Version, "-path", path, "vault")
bs, err := cmd.CombinedOutput()
if err != nil {
t.Logf("download: failed to download %s, retrying once: %v", b.Version, err)
cmd = exec.CommandContext(ctx, "hc-install", "install",
"-version", b.Version, "-path", path, "vault")
bs, err = cmd.CombinedOutput()
}
must.NoError(t, err, must.Sprintf("failed to download vault %s: %s", b.Version, string(bs)))
}

Expand Down

0 comments on commit d261d58

Please sign in to comment.