Skip to content

Commit

Permalink
Don't pass force
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Sep 19, 2023
1 parent 2cfd7d2 commit df1d988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/agent/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func installCmd(streams *cli.IOStreams, cmd *cobra.Command) error {

cfgFile := paths.ConfigFile()
if status != install.PackageInstall {
err = install.Install(cfgFile, topPath, force, pt)
err = install.Install(cfgFile, topPath, pt)
if err != nil {
return err
}
Expand Down
7 changes: 3 additions & 4 deletions internal/pkg/agent/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ const (
)

// Install installs Elastic Agent persistently on the system including creating and starting its service.
func Install(cfgFile, topPath string, force bool, pt *ProgressTracker) error {
func Install(cfgFile, topPath string, pt *ProgressTracker) error {
dir, err := findDirectory()
if err != nil {
return errors.New(err, "failed to discover the source directory for installation", errors.TypeFilesystem)
}

// We only uninstall currently-installed Agent if --force
// is present.
// We only uninstall Agent if it is currently installed.
status, _ := Status(topPath)
if status == Installed && force {
if status == Installed {
// Uninstall current installation
//
// There is no uninstall token for "install" command.
Expand Down

0 comments on commit df1d988

Please sign in to comment.