Skip to content

Commit

Permalink
Console URL is not displayed on OCP with loadbalancer ingress (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgiorgetti authored Jun 7, 2023
1 parent caf3373 commit ad3a1f9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions client/router_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

"github.com/skupperproject/skupper/pkg/utils"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand All @@ -18,7 +19,12 @@ import (
)

func (cli *VanClient) getConsoleUrl() (string, error) {
if cli.RouteClient == nil {
config, err := cli.SiteConfigInspect(context.Background(), nil)
if err != nil {
return "", err
}
routeClientIngress := utils.DefaultStr(config.Spec.Ingress, types.IngressRouteString)
if cli.RouteClient == nil || routeClientIngress != types.IngressRouteString {
service, err := cli.KubeClient.CoreV1().Services(cli.Namespace).Get(context.TODO(), types.ControllerServiceName, metav1.GetOptions{})
if err != nil {
return "", err
Expand All @@ -33,10 +39,6 @@ func (cli *VanClient) getConsoleUrl() (string, error) {
port = strconv.Itoa(int(p.NodePort))
}
}
config, err := cli.SiteConfigInspect(context.Background(), nil)
if err != nil {
return "", err
}
host := config.Spec.GetControllerIngressHost()
if host == "" || port == "" {
return "", nil
Expand Down

0 comments on commit ad3a1f9

Please sign in to comment.