Skip to content

Commit

Permalink
Fix profile list when profiles directory is missing
Browse files Browse the repository at this point in the history
This was reported in [1] and fixed in [2] in 2019. However the fix
assumed that `listProfiles()` can return `config.ErrNotExists` while it
returns `os.ErrNotExist` from `os.ReadDir`.

[1] kubernetes#5898
[2] kubernetes#5955
  • Loading branch information
nirs committed Jan 4, 2023
1 parent afe0f18 commit a429e68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func printProfilesJSON() {
updateProfilesStatus(validProfiles)

var body = map[string]interface{}{}
if err == nil || config.IsNotExist(err) {
if err == nil || os.IsNotExist(err) {
body["valid"] = profilesOrDefault(validProfiles)
body["invalid"] = profilesOrDefault(invalidProfiles)
jsonString, _ := json.Marshal(body)
Expand Down

0 comments on commit a429e68

Please sign in to comment.