diff --git a/changelog/fragments/1735664420-remove-deprecated-path-install-cli-flag.yaml b/changelog/fragments/1735664420-remove-deprecated-path-install-cli-flag.yaml new file mode 100644 index 00000000000..f0a3da1d2db --- /dev/null +++ b/changelog/fragments/1735664420-remove-deprecated-path-install-cli-flag.yaml @@ -0,0 +1,30 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: breaking-change + +# Change summary; a 80ish characters long description of the change. +summary: Removing --path.install option + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: "elastic-agent" +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/6461/files +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +issue: https://github.com/elastic/elastic-agent/issues/2489 diff --git a/internal/pkg/agent/application/paths/common.go b/internal/pkg/agent/application/paths/common.go index da4d2af7d51..463f7ea4fdb 100644 --- a/internal/pkg/agent/application/paths/common.go +++ b/internal/pkg/agent/application/paths/common.go @@ -84,7 +84,6 @@ func init() { fs.StringVar(&configFilePath, "config", DefaultConfigName, "Configuration file, relative to path.config") fs.StringVar(&configFilePath, "c", DefaultConfigName, "Configuration file, relative to path.config") fs.StringVar(&logsPath, "path.logs", logsPath, "Logs path contains Agent log output") - fs.StringVar(&installPath, "path.install", installPath, "DEPRECATED, setting this flag has no effect since v8.6.0") fs.StringVar(&controlSocketPath, "path.socket", controlSocketPath, "Control protocol socket path for the Agent") // enable user to download update artifacts to alternative place @@ -158,7 +157,6 @@ func SetConfig(path string) { // ConfigFile returns the path to the configuration file. func ConfigFile() string { - return configFileWithDefaultOverride(DefaultConfigName) } diff --git a/internal/pkg/agent/cmd/common.go b/internal/pkg/agent/cmd/common.go index 6047191d563..059c144399d 100644 --- a/internal/pkg/agent/cmd/common.go +++ b/internal/pkg/agent/cmd/common.go @@ -67,7 +67,6 @@ func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command { cmd.PersistentFlags().AddGoFlag(flag.CommandLine.Lookup("config")) cmd.PersistentFlags().AddGoFlag(flag.CommandLine.Lookup("path.logs")) cmd.PersistentFlags().AddGoFlag(flag.CommandLine.Lookup("path.downloads")) - cmd.PersistentFlags().AddGoFlag(flag.CommandLine.Lookup("path.install")) cmd.PersistentFlags().AddGoFlag(flag.CommandLine.Lookup("path.socket")) // logging flags diff --git a/internal/pkg/agent/cmd/container.go b/internal/pkg/agent/cmd/container.go index a983f4df3eb..84db4685a5b 100644 --- a/internal/pkg/agent/cmd/container.go +++ b/internal/pkg/agent/cmd/container.go @@ -417,9 +417,6 @@ func buildEnrollArgs(cfg setupConfig, token string, policyID string) ([]string, if paths.Downloads() != "" { args = append(args, "--path.downloads", paths.Downloads()) } - if paths.Install() != "" { - args = append(args, "--path.install", paths.Install()) - } if !paths.IsVersionHome() { args = append(args, "--path.home.unversioned") } diff --git a/internal/pkg/agent/cmd/enroll_cmd.go b/internal/pkg/agent/cmd/enroll_cmd.go index 91f652c9ef5..6c3df8e8998 100644 --- a/internal/pkg/agent/cmd/enroll_cmd.go +++ b/internal/pkg/agent/cmd/enroll_cmd.go @@ -663,9 +663,6 @@ func (c *enrollCmd) startAgent(ctx context.Context) (<-chan *os.ProcessState, er if paths.Downloads() != "" { args = append(args, "--path.downloads", paths.Downloads()) } - if paths.Install() != "" { - args = append(args, "--path.install", paths.Install()) - } if !paths.IsVersionHome() { args = append(args, "--path.home.unversioned") }