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

Improve fluxctl connection error #2001

Merged
merged 1 commit into from
May 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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