Skip to content

Commit

Permalink
Merge pull request #2453 from openziti/cli-login-json-mgmt-url
Browse files Browse the repository at this point in the history
assume ziti edge login command uses mgmt API unless --admin=false
  • Loading branch information
qrkourier authored Sep 27, 2024
2 parents f76e592 + 7d539e5 commit 81639b7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ziti/cmd/edge/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,19 @@ func (o *LoginOptions) Run() error {

idCredentials := edge_apis.NewIdentityCredentialsFromConfig(cfg.ID)
o.FileCertCreds = idCredentials
host = cfg.ZtAPI
ztAPI := cfg.ZtAPI

// override with the first HA client API URL if defined
if len(cfg.ZtAPIs) > 0 {
host = cfg.ZtAPIs[0]
ztAPI = cfg.ZtAPIs[0]
}

parsedZtAPI, err := url.Parse(ztAPI)
if err != nil {
return fmt.Errorf("could not parse ztAPI '%s' as a URL", ztAPI)
}

host = parsedZtAPI.Host
}

id := config.GetIdentity()
Expand Down

0 comments on commit 81639b7

Please sign in to comment.