Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2001 from 2opremio/improve-connection-error
Browse files Browse the repository at this point in the history
Improve fluxctl connection error
  • Loading branch information
2opremio authored May 1, 2019
2 parents 5c9bfdb + 32e9df5 commit 7fc70a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/fluxctl/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// Attempt to create PortForwards to fluxes that match the label selectors until a Flux
// is found or an error is returned.
func tryPortforwards(ns string, selectors ...metav1.LabelSelector) (p *portforward.PortForward, err error) {
message := fmt.Sprintf("Flux pod not found for labels in namespace %s:", ns)
message := fmt.Sprintf("No pod found in namespace %q using the following selectors:", ns)

for _, selector := range selectors {
p, err = tryPortforward(ns, selector)
Expand All @@ -27,7 +27,8 @@ func tryPortforwards(ns string, selectors ...metav1.LabelSelector) (p *portforwa
message = fmt.Sprintf("%s\n %s", message, metav1.FormatLabelSelector(&selector))
}
}

message = fmt.Sprintf("%s\n\nMake sure Flux is running in namespace %q.\n"+
"If Flux is running in another different namespace, please supply it to --k8s-fwd-ns.", message, ns)
if err != nil {
err = errors.New(message)
}
Expand Down

0 comments on commit 7fc70a8

Please sign in to comment.