Skip to content

Commit

Permalink
update morpheus datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Nov 4, 2024
1 parent 056e28a commit c965c21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions internal/cmp/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ package cmp

import (
"context"
"log"
"strconv"
"strings"

"github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk/pkg/client"
"github.com/HewlettPackard/hpegl-vmaas-terraform-resources/pkg/auth"
)

func setMeta(meta interface{}, apiClient client.APIClientHandler) {
// Not needed when not using wrapper
// Not needed while using cmp directly

// err := apiClient.SetMeta(meta, auth.SetScmClientToken)
// if err != nil {
// log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err)
// }
}
func setMetaHpegl(meta interface{}, apiClient client.APIClientHandler) {
err := apiClient.SetMeta(meta, auth.SetScmClientToken)
if err != nil {
log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err)
}
}

func ParseVersion(version string) (int, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmp/morpheus_datasource_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func newMorpheusBroker(bClient *client.BrokerAPIService) *morpheusBroker {

// Read reads the morpheus details using the Broker API
func (m *morpheusBroker) Read(ctx context.Context, d *utils.Data, meta interface{}) error {
setMeta(meta, m.bClient.Client)
setMetaHpegl(meta, m.bClient.Client)

// Get Morpheus Tokens and URL
morpheusDetails, err := m.bClient.GetMorpheusDetails(ctx)
Expand Down

0 comments on commit c965c21

Please sign in to comment.