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 authored and milan-zededa committed Jul 24, 2024
1 parent ffbccba commit 04badba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/expect/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (exp *AppExpectation) checkDataStoreHTTP(ds *config.DatastoreConfig) bool {
if err != nil {
log.Fatal(err)
}
if exp.httpDirectLoad && ds.Fqdn == fmt.Sprintf("%s://%s", u.Scheme, u.Hostname()) {
if exp.httpDirectLoad && ds.Fqdn == fmt.Sprintf("%s://%s", u.Scheme, u.Host) {
return true
}
}
Expand Down Expand Up @@ -142,7 +142,9 @@ func (exp *AppExpectation) createDataStoreHTTP(id uuid.UUID) *config.DatastoreCo
if u.Scheme == "https" {
ds.DType = config.DsType_DsHttps
}
ds.Fqdn = fmt.Sprintf("%s://%s", u.Scheme, u.Hostname())
// Use Host, just in case the http datastore address has a port number,
// we want to preserve it.
ds.Fqdn = fmt.Sprintf("%s://%s", u.Scheme, u.Host)
} else {
ds.Fqdn = fmt.Sprintf("http://%s:%s", exp.ctrl.GetVars().AdamDomain, exp.ctrl.GetVars().EServerPort)
}
Expand Down

0 comments on commit 04badba

Please sign in to comment.