From 6d661bc845eca45a18187300ad3b9a0b8d2feaf5 Mon Sep 17 00:00:00 2001 From: Tu Nguyen Date: Wed, 13 Nov 2024 13:53:08 -0800 Subject: [PATCH] Fix vagrant linux packages install, fix wget command based on feedback (#2620) * fix vagrant linux packages install, fix wget command based on feedback * address situation where linux doesnt exist for previous version of vagrant * Update src/views/product-downloads-view/index.tsx Co-authored-by: Heat Hamilton <55773810+heatlikeheatwave@users.noreply.github.com> * revert extraneous changes --------- Co-authored-by: Heat Hamilton <55773810+heatlikeheatwave@users.noreply.github.com> --- src/data/vault.json | 2 +- .../components/downloads-section/index.tsx | 2 +- src/views/product-downloads-view/helpers.ts | 4 ++-- src/views/product-downloads-view/index.tsx | 11 ++++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/data/vault.json b/src/data/vault.json index 75440c385c..708c49ef5d 100644 --- a/src/data/vault.json +++ b/src/data/vault.json @@ -103,7 +103,7 @@ { "label": "Ubuntu/Debian", "commands": [ - "wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg", + "wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg", "echo \"deb [arch=amd64 signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | sudo tee /etc/apt/sources.list.d/hashicorp.list", "sudo apt-get update && sudo apt-get install vault" ], diff --git a/src/views/product-downloads-view/components/downloads-section/index.tsx b/src/views/product-downloads-view/components/downloads-section/index.tsx index 51e155af19..d02acbf342 100644 --- a/src/views/product-downloads-view/components/downloads-section/index.tsx +++ b/src/views/product-downloads-view/components/downloads-section/index.tsx @@ -187,7 +187,7 @@ const DownloadsSection = ({ {' '} to learn how to install and verify HashiCorp tools on any Linux distribution, and create a custom Linux container - with verified HashiCorp tools.. + with verified HashiCorp tools. } icon={} diff --git a/src/views/product-downloads-view/helpers.ts b/src/views/product-downloads-view/helpers.ts index 9a94bd8c65..9edb076dbb 100644 --- a/src/views/product-downloads-view/helpers.ts +++ b/src/views/product-downloads-view/helpers.ts @@ -56,7 +56,7 @@ export const generateDefaultPackageManagers = ( { label: 'Ubuntu/Debian', commands: [ - `wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg`, + `wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg`, `echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list`, `sudo apt update && sudo apt install ${productSlug}`, ], @@ -117,7 +117,7 @@ export function generateEnterprisePackageManagers( { label: 'Ubuntu/Debian', commands: [ - `wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg`, + `wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg`, `echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list`, `sudo apt update && sudo apt install ${productSlug}-enterprise`, ], diff --git a/src/views/product-downloads-view/index.tsx b/src/views/product-downloads-view/index.tsx index cec07324ba..495e4c855c 100644 --- a/src/views/product-downloads-view/index.tsx +++ b/src/views/product-downloads-view/index.tsx @@ -93,11 +93,20 @@ const ProductDownloadsViewContent = ({ // Group the selected release downloads by OS, for use in multiple places const selectedRelease = releases.versions[currentVersion] - const downloadsByOS = useMemo( + let downloadsByOS = useMemo( () => sortPlatforms(selectedRelease), [selectedRelease] ) + if (currentProduct.slug === 'vagrant') { + downloadsByOS = { + ...downloadsByOS, + ...(downloadsByOS.linux?.amd64 + ? { linux: { amd64: downloadsByOS.linux.amd64 } } + : {}), + } + } + // Build download sidebar menu items, which vary with the selected release. const downloadMenuItems = Object.keys(downloadsByOS).map( (osKey: string): MenuItem => ({