Skip to content

Commit

Permalink
Fix CLI failed to setup port-forward caused by fission#712 (fission#867)
Browse files Browse the repository at this point in the history
  • Loading branch information
life1347 authored and garyyeap committed Sep 14, 2018
1 parent a40c872 commit d47dd77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fission/portforward/portforward.go
Expand Up @@ -132,7 +132,7 @@ func runPortForward(kubeConfig string, labelSelector string, localPort string, n
namespaces := make(map[string][]*v1.Pod)

// make a useful error message if there is more than one install
if len(podList.Items) > 1 {
if len(podList.Items) > 0 {
for _, p := range podList.Items {
if _, ok := namespaces[p.Namespace]; !ok {
namespaces[p.Namespace] = []*v1.Pod{}
Expand All @@ -146,6 +146,9 @@ func runPortForward(kubeConfig string, labelSelector string, localPort string, n
}
}

// there is at most one namespace in nsList,
// use index 0 to get from it directly.
ns = nsList[0]
pods, ok := namespaces[ns]
if !ok {
log.Fatal(fmt.Sprintf("Error finding fission install within the given namespace %v, please check FISSION_NAMESPACE is set properly", ns))
Expand Down

0 comments on commit d47dd77

Please sign in to comment.