display private bind endpoint (#109)

This commit is contained in:
Michael Quigley 2022-11-28 15:52:54 -05:00
parent a3956509f3
commit e65752b3e7
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -10,6 +10,7 @@ import (
"github.com/openziti-test-kitchen/zrok/zrokdir" "github.com/openziti-test-kitchen/zrok/zrokdir"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"net/url"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
@ -39,6 +40,14 @@ func newAccessPrivateCommand() *accessPrivateCommand {
func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) { func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {
svcName := args[0] svcName := args[0]
endpointUrl, err := url.Parse("http://" + cmd.bindAddress)
if err != nil {
if !panicInstead {
showError("invalid endpoint address", err)
}
panic(err)
}
env, err := zrokdir.LoadEnvironment() env, err := zrokdir.LoadEnvironment()
if err != nil { if err != nil {
if !panicInstead { if !panicInstead {
@ -88,6 +97,9 @@ func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {
} }
panic(err) panic(err)
} }
logrus.Infof("access your service at: %v", endpointUrl.String())
if err := frontend.Run(); err != nil { if err := frontend.Run(); err != nil {
if !panicInstead { if !panicInstead {
showError("unable to run frontend", err) showError("unable to run frontend", err)