Skip to content

Commit

Permalink
Fix http datastore fqdn address
Browse files Browse the repository at this point in the history
In case the http datastore address has a port number, the datastore address
should contain both the hostname and the port.

Signed-off-by: Shahriyar Jalayeri <[email protected]>
  • Loading branch information
shjala committed Jul 24, 2024
1 parent ffbccba commit a81166f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/expect/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ func (exp *AppExpectation) createDataStoreHTTP(id uuid.UUID) *config.DatastoreCo
ds.DType = config.DsType_DsHttps
}
ds.Fqdn = fmt.Sprintf("%s://%s", u.Scheme, u.Hostname())
// In case the http datastore address has a port number,
// the datastore address should contain both the hostname and the port.
if u.Port() != "" {
ds.Fqdn = fmt.Sprintf("%s:%s", ds.Fqdn, u.Port())
}
} else {
ds.Fqdn = fmt.Sprintf("http://%s:%s", exp.ctrl.GetVars().AdamDomain, exp.ctrl.GetVars().EServerPort)
}
Expand Down

0 comments on commit a81166f

Please sign in to comment.