Skip to content

Commit

Permalink
add sethost and trim / in the cmp url
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Oct 30, 2024
1 parent e7c95d2 commit 3719e78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/client/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strings"

consts "github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk/pkg/common"
"github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk/pkg/models"
Expand Down Expand Up @@ -61,7 +62,7 @@ func (a *BrokerAPIService) GetMorpheusDetails(ctx context.Context) (models.TFMor
ID: ServiceSubscriptionDetailsResp.ServiceInstanceID,
AccessToken: MorpheusTokenResp.AccessToken,
ValidTill: MorpheusTokenResp.Expires,
URL: ServiceSubscriptionDetailsResp.URL,
URL: strings.TrimSuffix(ServiceSubscriptionDetailsResp.URL, "/"),
}

return ret, nil
Expand Down
4 changes: 3 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ func NewAPIClient(cfg *Configuration) *APIClient {
func (c *APIClient) getHost() string {
return c.cfg.Host
}

func (c *APIClient) SetHost(host string) {
c.cfg.Host = host
}
func (c *APIClient) SetMeta(meta interface{}, fn SetScmClientToken) error {
c.meta = meta
c.tokenFunc = fn
Expand Down

0 comments on commit 3719e78

Please sign in to comment.