From 66ae9eb5b07ed645317a9b426038782df5df3f60 Mon Sep 17 00:00:00 2001 From: Cameron Perera Date: Mon, 12 Dec 2022 18:55:28 -0600 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Update=20byow=20install?= =?UTF-8?q?=20boundary=20command=20for=20hcp=20edition=20(#1522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 Update byow install boundary command for hcp edition * refactor: 💡 update version in download url for boundary worker --- .../form/worker/create-worker-led/index.js | 6 ++++++ .../tests/acceptance/workers/create-test.js | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.js b/ui/admin/app/components/form/worker/create-worker-led/index.js index b1c804d60..3b7bfdc27 100644 --- a/ui/admin/app/components/form/worker/create-worker-led/index.js +++ b/ui/admin/app/components/form/worker/create-worker-led/index.js @@ -108,6 +108,12 @@ ${listenerText} * @type {string} */ get installBoundaryText() { + if (this.features.isEnabled('byow-pki-hcp-cluster-id')) { + return `wget -q https://releases.hashicorp.com/boundary-worker/0.11.2+hcp/boundary-worker_0.11.2+hcp_linux_amd64.zip ;\\ +sudo apt-get update && sudo apt-get install unzip ;\\ +unzip *.zip ;\\ +./boundary-worker server -config="${this.configFilePath || ''}/pki-worker.hcl"`; + } return `curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - ;\\ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" ;\\ sudo apt-get update && sudo apt-get install boundary ;\\ diff --git a/ui/admin/tests/acceptance/workers/create-test.js b/ui/admin/tests/acceptance/workers/create-test.js index e49fac281..2f4c9ae6f 100644 --- a/ui/admin/tests/acceptance/workers/create-test.js +++ b/ui/admin/tests/acceptance/workers/create-test.js @@ -60,6 +60,26 @@ module('Acceptance | workers | create', function (hooks) { assert.dom(labels[2]).hasText('Initial Upstreams'); }); + test('download and install step shows correct oss instructions', async function (assert) { + assert.expect(2); + const featuresService = this.owner.lookup('service:features'); + featuresService.disable('byow-pki-hcp-cluster-id'); + await visit(newWorkerURL); + const createSection = findAll('.worker-create-section'); + assert.dom(createSection[1]).includesText('curl -fsSL'); + assert.dom(createSection[1]).doesNotIncludeText('wget -q'); + }); + + test('download and install step shows correct hcp instructions', async function (assert) { + assert.expect(2); + const featuresService = this.owner.lookup('service:features'); + featuresService.enable('byow-pki-hcp-cluster-id'); + await visit(newWorkerURL); + const createSection = findAll('.worker-create-section'); + assert.dom(createSection[1]).includesText('wget -q'); + assert.dom(createSection[1]).doesNotIncludeText('curl -fsSL'); + }); + test('Users can navigate to new workers route with proper authorization', async function (assert) { assert.expect(2); await visit(newWorkerURL);