display installed and non-installed drivers in separate lists

pull/13147/head
Ashwin901 2021-12-12 12:28:13 +05:30
parent 80a3435e1f
commit daa270ec0c
1 changed files with 14 additions and 1 deletions

View File

@ -627,8 +627,21 @@ func selectDriver(existing *config.ClusterConfig) (registry.DriverState, []regis
}
return rejects[i].Priority > rejects[j].Priority
})
// Display the issue for installed drivers
for _, r := range rejects {
if !r.Default {
if r.Default && r.State.Installed {
out.Infof("{{ .name }}: {{ .rejection }}", out.V{"name": r.Name, "rejection": r.Rejection})
if r.Suggestion != "" {
out.Infof("{{ .name }}: Suggestion: {{ .suggestion}}", out.V{"name": r.Name, "suggestion": r.Suggestion})
}
}
}
// Display the other drivers users can install
out.Step(style.Tip, "Alternatively you could install one of these drivers:")
for _, r := range rejects {
if !r.Default || r.State.Installed {
continue
}
out.Infof("{{ .name }}: {{ .rejection }}", out.V{"name": r.Name, "rejection": r.Rejection})