From 04badba3bdf1053ae64a3773cf681c46528ab80e Mon Sep 17 00:00:00 2001 From: Shahriyar Jalayeri Date: Wed, 24 Jul 2024 12:32:36 +0300 Subject: [PATCH] Fix http datastore fqdn address 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 --- pkg/expect/http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/expect/http.go b/pkg/expect/http.go index 341074bbb..a376b05bd 100644 --- a/pkg/expect/http.go +++ b/pkg/expect/http.go @@ -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 } } @@ -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) }