Skip to content

Commit

Permalink
Merge pull request #3383 from ramineni/use-envoy-sidecar-url
Browse files Browse the repository at this point in the history
fix: lookup client to use envoy sidecar url if enabled
  • Loading branch information
dougm authored Mar 11, 2024
2 parents e4c027e + 8375477 commit 1fb3f62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lookup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"log"
"net/url"

"github.com/vmware/govmomi/internal"
"github.com/vmware/govmomi/lookup/methods"
"github.com/vmware/govmomi/lookup/types"
"github.com/vmware/govmomi/object"
Expand Down Expand Up @@ -55,9 +56,9 @@ type Client struct {

// NewClient returns a client targeting the SSO Lookup Service API endpoint.
func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) {
// PSC may be external, attempt to derive from sts.uri
path := &url.URL{Path: Path}
if c.ServiceContent.Setting != nil {
// PSC may be external, attempt to derive from sts.uri if not using envoy sidecar
if !internal.UsingEnvoySidecar(c) && c.ServiceContent.Setting != nil {
m := object.NewOptionManager(c, *c.ServiceContent.Setting)
opts, err := m.Query(ctx, "config.vpxd.sso.sts.uri")
if err == nil && len(opts) == 1 {
Expand Down

0 comments on commit 1fb3f62

Please sign in to comment.