Skip to content

Commit

Permalink
return pointer to k8sissue
Browse files Browse the repository at this point in the history
  • Loading branch information
sharifelgamal committed May 3, 2021
1 parent 9dbe957 commit e27e9a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ func validateKubernetesVersion(old *config.ClusterConfig) {
}

// If the version of Kubernetes has a known issue, print a warning out to the screen
if issue := reason.ProblematicK8sVersion(nvs); issue.Description != "" {
if issue := reason.ProblematicK8sVersion(nvs); issue != nil {
out.WarningT(issue.Description, out.V{"version": nvs.String()})
if issue.URL != "" {
out.WarningT("For more information, see: {{.url}}", out.V{"url": issue.URL})
Expand Down
7 changes: 4 additions & 3 deletions pkg/minikube/reason/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ var k8sIssues = []K8sIssue{
},
}

func ProblematicK8sVersion(v semver.Version) K8sIssue {
// ProblematicK8sVersion checks for the supplied Kubernetes version and checks if there's a known issue with it.
func ProblematicK8sVersion(v semver.Version) *K8sIssue {
for _, issue := range k8sIssues {
for _, va := range issue.VersionsAffected {
if va == v.String() {
return issue
return &issue
}
}
}
return K8sIssue{}
return nil
}

0 comments on commit e27e9a1

Please sign in to comment.