Skip to content

Commit

Permalink
bubble up NotExist error
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Mar 20, 2024
1 parent 9799e5f commit e2fcc47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var hostAndDirsDeleter = func(api libmachine.API, cc *config.ClusterConfig, prof
if err := killMountProcess(); err != nil {
out.FailureT("Failed to kill mount process: {{.error}}", out.V{"error": err})
}
if err := sshagent.Stop(profileName); err != nil {
if err := sshagent.Stop(profileName); err != nil && !config.IsNotExist(err) {
out.FailureT("Failed to stop ssh-agent process: {{.error}}", out.V{"error": err})
}

Expand Down
5 changes: 1 addition & 4 deletions pkg/minikube/sshagent/sshagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ func isRunning(cc *config.ClusterConfig) (bool, error) {
func Stop(profile string) error {
cc, err := config.Load(profile)
if err != nil {
if config.IsNotExist(err) {
return nil
}
return fmt.Errorf("failed loading config: %v", err)
return err
}
running, err := isRunning(cc)
if err != nil {
Expand Down

0 comments on commit e2fcc47

Please sign in to comment.