From e7439e2e2d18bda4e6a3b6238428e9e3e59bd9a3 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Wed, 4 Oct 2023 18:00:53 -0700 Subject: [PATCH] Un-hide `--base-path` install flag (#3517) (cherry picked from commit 0ba1a445adbf880f00d6373d58c887c3d448b060) --- internal/pkg/agent/cmd/install.go | 6 ------ testing/integration/install_test.go | 9 --------- 2 files changed, 15 deletions(-) diff --git a/internal/pkg/agent/cmd/install.go b/internal/pkg/agent/cmd/install.go index 410c232e65b..4fbd37f40da 100644 --- a/internal/pkg/agent/cmd/install.go +++ b/internal/pkg/agent/cmd/install.go @@ -45,12 +45,6 @@ would like the Agent to operate. cmd.Flags().String(flagInstallBasePath, paths.DefaultBasePath, "The path where the Elastic Agent will be installed. It must be an absolute path.") addEnrollFlags(cmd) - // We are not supporting a custom base path, supplied via the `--base-path` CLI - // flag, just yet because we don't have Endpoint support for it yet. So we mark - // this flag as hidden. - // See also: https://github.com/elastic/elastic-agent/pull/2592 - _ = cmd.Flags().MarkHidden(flagInstallBasePath) - return cmd } diff --git a/testing/integration/install_test.go b/testing/integration/install_test.go index 808799aeb66..e2e9d0206cf 100644 --- a/testing/integration/install_test.go +++ b/testing/integration/install_test.go @@ -88,15 +88,6 @@ func TestInstallWithBasePath(t *testing.T) { err = fixture.Prepare(context.Background()) require.NoError(t, err) - // The `--base-path` flag is defined for the `elastic-agent install` CLI sub-command BUT - // it is hidden (see https://github.com/elastic/elastic-agent/pull/2592). So we validate - // here that the usage text for the `install` sub-command does NOT mention the `--base-path` - // flag in it. - const basePathFlag = "--base-path" - output, err := fixture.Exec(context.Background(), []string{"help", "install"}) - require.NoError(t, err) - require.NotContains(t, string(output), basePathFlag) - // Set up random temporary directory to serve as base path for Elastic Agent // installation. tmpDir := t.TempDir()