From 3af7fcebba7cc871ead55b99484a383b7ea93191 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Wed, 30 Oct 2024 19:38:36 +0530 Subject: [PATCH 01/13] Switch to cmp endpoint --- go.mod | 2 +- go.sum | 12 ++++++++++++ internal/cmp/cloud.go | 2 +- internal/cmp/helper.go | 10 ++++------ pkg/client/client.go | 43 ++++++++++++++++++++++-------------------- pkg/utils/meta.go | 41 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 82 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index a64f8f6f..a2d4d6cf 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.21 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.13 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85 github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 diff --git a/go.sum b/go.sum index 122e5905..0a2f468f 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,18 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.13 h1:UnTm9GYtLqRe3M5XRcmFAqKQElnIoX/MEgPF5VJWfqY= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.13/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241029111536-2a67a31003c2 h1:6yVhxvpy7e8Q8+WCB1WKO9dneTFQ8x6R+wSbj7Ks164= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241029111536-2a67a31003c2/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030072725-d69ab92a2c1c h1:x5OGFFCIZDulcZLxwrTYHhOJa3ws/33dXbVB2LWnq+I= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030072725-d69ab92a2c1c/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030074152-bc7bf5eafc66 h1:Qlbwu/spa4YQ2cTWmdtmdk3MBil6lWhX++XxjcpKGNI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030074152-bc7bf5eafc66/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030084153-e7c95d2717fa h1:4XKOpsGk4myFx9/0BXC6t9EXBN/alN7MR/bJ7ebOVi4= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030084153-e7c95d2717fa/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7819ba2 h1:MWANl9Kv4AOlv1G25bUfBheuqKyH1JlWUyIB3qt3lJE= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7819ba2/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85 h1:sM6MYauADnyf06GD57rjwyhydqFfz6tRy0z0TWcYI0g= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= diff --git a/internal/cmp/cloud.go b/internal/cmp/cloud.go index 70dabb87..191a96a8 100644 --- a/internal/cmp/cloud.go +++ b/internal/cmp/cloud.go @@ -29,7 +29,7 @@ func (c *cloud) Read(ctx context.Context, d *utils.Data, meta interface{}) error if err := d.Error(); err != nil { return err } - cloud, err := c.cloudClient.GetAllClouds(ctx, map[string]string{ + cloud, err := c.cloudClient.GetAllClouds(context.WithoutCancel(ctx), map[string]string{ nameKey: name, }) if err != nil { diff --git a/internal/cmp/helper.go b/internal/cmp/helper.go index 9b0d86eb..2e6a5644 100644 --- a/internal/cmp/helper.go +++ b/internal/cmp/helper.go @@ -4,19 +4,17 @@ 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) { - err := apiClient.SetMeta(meta, auth.SetScmClientToken) - if err != nil { - log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err) - } + // 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) { diff --git a/pkg/client/client.go b/pkg/client/client.go index 2e6b1800..0b3c84b4 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -68,37 +68,40 @@ func (i InitialiseClient) NewClient(r *schema.ResourceData) (interface{}, error) queryParam[constants.SpaceKey] = vmaasProviderSettings[constants.SPACENAME].(string) } - // Create cmp client - cfg := api_client.Configuration{ - Host: vmaasProviderSettings[constants.APIURL].(string), - DefaultHeader: getHeaders(), - DefaultQueryParams: queryParam, - } - apiClient := api_client.NewAPIClient(&cfg) - utils.SetMeta(apiClient, r) - client.CmpClient = cmp_client.NewClient(apiClient, cfg) - // Create broker client brokerHeaders := getHeaders() tenantID := r.Get(constants.TenantID).(string) brokerHeaders["X-Tenant-ID"] = tenantID // We don't add default query params to broker client brokerCfgForAPIClient := api_client.Configuration{ - Host: vmaasProviderSettings[constants.BROKERRURL].(string), - DefaultHeader: brokerHeaders, - } - brokerApiClient := api_client.NewAPIClient(&brokerCfgForAPIClient) - utils.SetMetaFnAndVersion(brokerApiClient, r, apiClient.GetSCMVersion()) - - // brokerCfg is passed down to NewBrokerClient. It is used mainly to set the query params - // for the call to get SubscriptionDetails - brokerCfg := api_client.Configuration{ Host: vmaasProviderSettings[constants.BROKERRURL].(string), DefaultHeader: brokerHeaders, DefaultQueryParams: queryParam, } - client.BrokerClient = cmp_client.NewBrokerClient(brokerApiClient, brokerCfg) + brokerApiClient := api_client.NewAPIClient(&brokerCfgForAPIClient) + utils.SetMetaFnAndVersion(brokerApiClient, r, 0) + // Create cmp client + cfg := api_client.Configuration{ + // Host: vmaasProviderSettings[constants.APIURL].(string), + // DefaultHeader: getHeaders(), + // DefaultQueryParams: queryParam, + } + apiClient := api_client.NewAPIClient(&cfg) + // utils.SetMeta(apiClient, r) + cfg, err = utils.SetCMPVars(apiClient, brokerApiClient) + if err != nil { + return nil, fmt.Errorf("[ERROR]: unable to set cmp metadata %v", err) + } + client.CmpClient = cmp_client.NewClient(apiClient, cfg) + // brokerCfg is passed down to NewBrokerClient. It is used mainly to set the query params + // for the call to get SubscriptionDetails + // brokerCfg := api_client.Configuration{ + // Host: vmaasProviderSettings[constants.BROKERRURL].(string), + // DefaultHeader: brokerHeaders, + // DefaultQueryParams: queryParam, + // } + client.BrokerClient = cmp_client.NewBrokerClient(brokerApiClient, brokerCfgForAPIClient) return client, nil } diff --git a/pkg/utils/meta.go b/pkg/utils/meta.go index dac87499..81dd1487 100644 --- a/pkg/utils/meta.go +++ b/pkg/utils/meta.go @@ -51,3 +51,44 @@ func SetMetaFnAndVersion(apiClient *client.APIClient, r *schema.ResourceData, ve } }) } +func SetCMPVars(apiClient, brokerClient *client.APIClient) (cfg client.Configuration, err error) { + cmpDetails, err := brokerClient.GetCMPVars(context.Background()) + apiClient.SetHostandToken(cmpDetails.URL, cmpDetails.AccessToken) + apiClient.SetCMPVersion(context.Background()) + cfg.Host = cmpDetails.URL + cfg.DefaultQueryParams = map[string]string{} + cfg.DefaultHeader = map[string]string{"Authorization": "Bearer " + cmpDetails.AccessToken} + apiClient.SetCMPMeta(nil, brokerClient, func(ctx *context.Context, meta interface{}) { + // Initialise token handler + // client.GetClientFromMetaMap(meta) + cmpDetails, err := brokerClient.GetCMPVars(*ctx) + + if err != nil { + log.Printf("[ERROR] Unable to fetch token for CMP client: %s", err) + + } else { + apiClient.SetHostandToken(cmpDetails.URL, cmpDetails.AccessToken) + // *ctx = context.WithValue(*ctx, client.ContextAccessToken, cmpDetails.AccessToken) + } + }) + // if err != nil { + // log.Printf("[WARN] Error: %s", err) + // } + return + // apiClient.SetMetaFnAndVersion(nil, version, func(ctx *context.Context, meta interface{}) { + // // Initialise token handler + // h, err := serviceclient.NewHandler(r) + // if err != nil { + // log.Printf("[WARN] Unable to fetch token for SCM client: %s", err) + // } + + // // Get token retrieve func and put in c + // trf := retrieve.NewTokenRetrieveFunc(h) + // token, err := trf(*ctx) + // if err != nil { + // log.Printf("[WARN] Unable to fetch token for SCM client: %s", err) + // } else { + // *ctx = context.WithValue(*ctx, client.ContextAccessToken, token) + // } + // }) +} From 87612444b53f0ecd0b3cfa20432c7da8e28f1c02 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Thu, 31 Oct 2024 13:47:17 +0530 Subject: [PATCH 02/13] Switch to cmp --- go.mod | 2 +- go.sum | 4 ++++ internal/cmp/cloud.go | 2 +- internal/cmp/helper.go | 2 ++ pkg/client/client.go | 17 +++++---------- pkg/utils/meta.go | 49 ++++++++++++++++-------------------------- 6 files changed, 31 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index a2d4d6cf..d103b411 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.21 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 diff --git a/go.sum b/go.sum index 0a2f468f..7edf3ea7 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,10 @@ github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7 github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7819ba2/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85 h1:sM6MYauADnyf06GD57rjwyhydqFfz6tRy0z0TWcYI0g= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031080330-2b4bf1278fd0 h1:UwouUIlwAZyfykSmRhku2Bnaee/MJkTn8imEM6hH0Ms= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031080330-2b4bf1278fd0/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 h1:W4U6n4DNm+6TcBHEPh2/KaWkb8jPWOBLsIUkUZqY9Mg= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= diff --git a/internal/cmp/cloud.go b/internal/cmp/cloud.go index 191a96a8..70dabb87 100644 --- a/internal/cmp/cloud.go +++ b/internal/cmp/cloud.go @@ -29,7 +29,7 @@ func (c *cloud) Read(ctx context.Context, d *utils.Data, meta interface{}) error if err := d.Error(); err != nil { return err } - cloud, err := c.cloudClient.GetAllClouds(context.WithoutCancel(ctx), map[string]string{ + cloud, err := c.cloudClient.GetAllClouds(ctx, map[string]string{ nameKey: name, }) if err != nil { diff --git a/internal/cmp/helper.go b/internal/cmp/helper.go index 2e6a5644..ad192da9 100644 --- a/internal/cmp/helper.go +++ b/internal/cmp/helper.go @@ -11,6 +11,8 @@ import ( ) func setMeta(meta interface{}, apiClient client.APIClientHandler) { + // Not needed when not using wrapper + // err := apiClient.SetMeta(meta, auth.SetScmClientToken) // if err != nil { // log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err) diff --git a/pkg/client/client.go b/pkg/client/client.go index 0b3c84b4..5ebef358 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -82,25 +82,18 @@ func (i InitialiseClient) NewClient(r *schema.ResourceData) (interface{}, error) utils.SetMetaFnAndVersion(brokerApiClient, r, 0) // Create cmp client cfg := api_client.Configuration{ - // Host: vmaasProviderSettings[constants.APIURL].(string), - // DefaultHeader: getHeaders(), - // DefaultQueryParams: queryParam, + Host: "", + DefaultHeader: map[string]string{}, + DefaultQueryParams: map[string]string{}, } apiClient := api_client.NewAPIClient(&cfg) - // utils.SetMeta(apiClient, r) - cfg, err = utils.SetCMPVars(apiClient, brokerApiClient) + err = utils.SetCMPVars(apiClient, brokerApiClient, &cfg) if err != nil { return nil, fmt.Errorf("[ERROR]: unable to set cmp metadata %v", err) } client.CmpClient = cmp_client.NewClient(apiClient, cfg) + utils.SetMetaFnAndVersion(brokerApiClient, r, apiClient.GetSCMVersion()) - // brokerCfg is passed down to NewBrokerClient. It is used mainly to set the query params - // for the call to get SubscriptionDetails - // brokerCfg := api_client.Configuration{ - // Host: vmaasProviderSettings[constants.BROKERRURL].(string), - // DefaultHeader: brokerHeaders, - // DefaultQueryParams: queryParam, - // } client.BrokerClient = cmp_client.NewBrokerClient(brokerApiClient, brokerCfgForAPIClient) return client, nil } diff --git a/pkg/utils/meta.go b/pkg/utils/meta.go index 81dd1487..3d4bc6df 100644 --- a/pkg/utils/meta.go +++ b/pkg/utils/meta.go @@ -51,44 +51,31 @@ func SetMetaFnAndVersion(apiClient *client.APIClient, r *schema.ResourceData, ve } }) } -func SetCMPVars(apiClient, brokerClient *client.APIClient) (cfg client.Configuration, err error) { - cmpDetails, err := brokerClient.GetCMPVars(context.Background()) - apiClient.SetHostandToken(cmpDetails.URL, cmpDetails.AccessToken) - apiClient.SetCMPVersion(context.Background()) +func SetCMPVars(apiClient, brokerClient *client.APIClient, cfg *client.Configuration) (err error) { + cmpDetails, err := brokerClient.GetCMPDetails(context.Background()) + if err != nil { + log.Printf("[ERROR] Unable to fetch token for CMP client: %s", err) + return + } + apiClient.SetHost(cmpDetails.URL) + ctx := context.Background() + ctx = context.WithValue(ctx, client.ContextAccessToken, cmpDetails.AccessToken) + err = apiClient.SetCMPVersion(ctx) + if err != nil { + log.Printf("[ERROR] Unable to set CMP version client: %s", err) + return + } cfg.Host = cmpDetails.URL - cfg.DefaultQueryParams = map[string]string{} - cfg.DefaultHeader = map[string]string{"Authorization": "Bearer " + cmpDetails.AccessToken} + apiClient.SetCMPMeta(nil, brokerClient, func(ctx *context.Context, meta interface{}) { // Initialise token handler - // client.GetClientFromMetaMap(meta) - cmpDetails, err := brokerClient.GetCMPVars(*ctx) - + cmpDetails, err := brokerClient.GetCMPDetails(*ctx) if err != nil { log.Printf("[ERROR] Unable to fetch token for CMP client: %s", err) - } else { - apiClient.SetHostandToken(cmpDetails.URL, cmpDetails.AccessToken) - // *ctx = context.WithValue(*ctx, client.ContextAccessToken, cmpDetails.AccessToken) + *ctx = context.WithValue(*ctx, client.ContextAccessToken, cmpDetails.AccessToken) } }) - // if err != nil { - // log.Printf("[WARN] Error: %s", err) - // } - return - // apiClient.SetMetaFnAndVersion(nil, version, func(ctx *context.Context, meta interface{}) { - // // Initialise token handler - // h, err := serviceclient.NewHandler(r) - // if err != nil { - // log.Printf("[WARN] Unable to fetch token for SCM client: %s", err) - // } - // // Get token retrieve func and put in c - // trf := retrieve.NewTokenRetrieveFunc(h) - // token, err := trf(*ctx) - // if err != nil { - // log.Printf("[WARN] Unable to fetch token for SCM client: %s", err) - // } else { - // *ctx = context.WithValue(*ctx, client.ContextAccessToken, token) - // } - // }) + return err } From 460aadfc138c99647be0e0e26b62c2d0d39c3335 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 14:30:03 +0530 Subject: [PATCH 03/13] update the atf --- internal/acceptance_test/helper.go | 67 ++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/internal/acceptance_test/helper.go b/internal/acceptance_test/helper.go index 4722d409..d979127f 100644 --- a/internal/acceptance_test/helper.go +++ b/internal/acceptance_test/helper.go @@ -15,43 +15,68 @@ import ( "github.com/hewlettpackard/hpegl-provider-lib/pkg/token/serviceclient" ) -func getAPIClient() (*api_client.APIClient, api_client.Configuration) { +// func getOldAPIClient() (*api_client.APIClient, api_client.Configuration) { +// headers, queryParam, iamVersion := getHeadersAndQueryParamsAndIAMVersion() +// cfg := api_client.Configuration{ +// Host: os.Getenv("HPEGL_VMAAS_API_URL"), +// DefaultHeader: headers, +// DefaultQueryParams: queryParam, +// } +// apiClient := api_client.NewAPIClient(&cfg) +// err := apiClientSetMeta(apiClient, iamVersion) +// if err != nil { +// log.Printf("[WARN] Error: %s", err) +// } + +// return apiClient, cfg +// } + +func getBrokerAPIClient() (*api_client.APIClient, api_client.Configuration) { headers, queryParam, iamVersion := getHeadersAndQueryParamsAndIAMVersion() + cfg := api_client.Configuration{ - Host: os.Getenv("HPEGL_VMAAS_API_URL"), + Host: os.Getenv("HPEGL_VMAAS_BROKER_URL"), DefaultHeader: headers, DefaultQueryParams: queryParam, } - apiClient := api_client.NewAPIClient(&cfg) - err := apiClientSetMeta(apiClient, iamVersion) + brokerAPIClient := api_client.NewAPIClient(&cfg) + err := apiClientSetMeta(brokerAPIClient, iamVersion) if err != nil { log.Printf("[WARN] Error: %s", err) } - return apiClient, cfg + return brokerAPIClient, cfg } -func getBrokerAPIClient() (*api_client.APIClient, api_client.Configuration) { - headers, queryParam, iamVersion := getHeadersAndQueryParamsAndIAMVersion() - // No need to set the default query params for broker API +func getAPIClient() (*api_client.APIClient, api_client.Configuration) { + ctx := context.Background() + brokerClient, _ := getBrokerAPIClient() + cmpDetails, err := brokerClient.GetCMPDetails(ctx) + if err != nil { + log.Printf("[ERROR] Error getting cmp details: %s", err) + } cfg := api_client.Configuration{ - Host: os.Getenv("HPEGL_VMAAS_BROKER_URL"), - DefaultHeader: headers, + Host: cmpDetails.URL, + DefaultHeader: map[string]string{}, + DefaultQueryParams: map[string]string{}, } - brokerAPIClient := api_client.NewAPIClient(&cfg) - err := apiClientSetMeta(brokerAPIClient, iamVersion) + cmpAPIClient := api_client.NewAPIClient(&cfg) + cmpAPIClient.SetCMPMeta(nil, brokerClient, func(ctx *context.Context, meta interface{}) { + // Initialise token handler + cmpDetails, err := brokerClient.GetCMPDetails(*ctx) + if err != nil { + log.Printf("[ERROR] Unable to fetch token for CMP client: %s", err) + } else { + *ctx = context.WithValue(*ctx, api_client.ContextAccessToken, cmpDetails.AccessToken) + } + }) + ctx = context.WithValue(ctx, api_client.ContextAccessToken, cmpDetails.AccessToken) + err = cmpAPIClient.SetCMPVersion(ctx) if err != nil { - log.Printf("[WARN] Error: %s", err) - } + log.Printf("[ERROR] Unable to set CMP version client: %s", err) - // Return the configuration with the default query params - cfgForReturn := api_client.Configuration{ - Host: os.Getenv("HPEGL_VMAAS_BROKER_URL"), - DefaultHeader: headers, - DefaultQueryParams: queryParam, } - - return brokerAPIClient, cfgForReturn + return cmpAPIClient, cfg } func getHeadersAndQueryParamsAndIAMVersion() (map[string]string, map[string]string, string) { From f1dfbd38a62620186bfc4b0521949d7e521e4ebf Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 14:49:53 +0530 Subject: [PATCH 04/13] parallel = 1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f0e328e2..5bc62dd3 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ acceptance: @if [ "${case}" != "" ]; then \ TF_ACC=true go test -parallel 1 -count 1 -run $(case) -v -timeout=20000s -cover $(ACC_TEST_FILE_LOCATION); \ else \ - TF_ACC=true go test -parallel 4 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ + TF_ACC=true go test -parallel 1 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ fi build: vendor $(NAME) From db8d0eb8b0b4992144c9cc02e7150410436473dc Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 15:54:01 +0530 Subject: [PATCH 05/13] rever provider-lib to v0.0.17 and parallel 4 --- Makefile | 2 +- go.mod | 2 +- go.sum | 20 ++------------------ 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 5bc62dd3..f0e328e2 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ acceptance: @if [ "${case}" != "" ]; then \ TF_ACC=true go test -parallel 1 -count 1 -run $(case) -v -timeout=20000s -cover $(ACC_TEST_FILE_LOCATION); \ else \ - TF_ACC=true go test -parallel 1 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ + TF_ACC=true go test -parallel 4 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ fi build: vendor $(NAME) diff --git a/go.mod b/go.mod index d103b411..ebad34b7 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hewlettpackard/hpegl-provider-lib v0.0.20 + github.com/hewlettpackard/hpegl-provider-lib v0.0.17 github.com/spf13/viper v1.18.2 github.com/tidwall/gjson v1.14.1 github.com/tshihad/tftags v0.0.10 diff --git a/go.sum b/go.sum index 7edf3ea7..f45b74e2 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,5 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.13 h1:UnTm9GYtLqRe3M5XRcmFAqKQElnIoX/MEgPF5VJWfqY= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.13/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241029111536-2a67a31003c2 h1:6yVhxvpy7e8Q8+WCB1WKO9dneTFQ8x6R+wSbj7Ks164= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241029111536-2a67a31003c2/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030072725-d69ab92a2c1c h1:x5OGFFCIZDulcZLxwrTYHhOJa3ws/33dXbVB2LWnq+I= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030072725-d69ab92a2c1c/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030074152-bc7bf5eafc66 h1:Qlbwu/spa4YQ2cTWmdtmdk3MBil6lWhX++XxjcpKGNI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030074152-bc7bf5eafc66/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030084153-e7c95d2717fa h1:4XKOpsGk4myFx9/0BXC6t9EXBN/alN7MR/bJ7ebOVi4= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030084153-e7c95d2717fa/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7819ba2 h1:MWANl9Kv4AOlv1G25bUfBheuqKyH1JlWUyIB3qt3lJE= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030101251-3719e7819ba2/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85 h1:sM6MYauADnyf06GD57rjwyhydqFfz6tRy0z0TWcYI0g= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241030131248-be6b464d9a85/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031080330-2b4bf1278fd0 h1:UwouUIlwAZyfykSmRhku2Bnaee/MJkTn8imEM6hH0Ms= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031080330-2b4bf1278fd0/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 h1:W4U6n4DNm+6TcBHEPh2/KaWkb8jPWOBLsIUkUZqY9Mg= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -140,8 +124,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hewlettpackard/hpegl-provider-lib v0.0.20 h1:QbZUQwr08aI2zELk/V+0OTaJe0LSVGklG99cQh4hUVA= -github.com/hewlettpackard/hpegl-provider-lib v0.0.20/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= +github.com/hewlettpackard/hpegl-provider-lib v0.0.17 h1:6sh4XjWK2hg2q5V78W4AypV0IBbDy0CpGoMfzE1CK1c= +github.com/hewlettpackard/hpegl-provider-lib v0.0.17/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= From 056e28afefc977ed3a60e7aafad5cbfcec6a59cc Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 16:19:59 +0530 Subject: [PATCH 06/13] parallel= 2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f0e328e2..e17e9dd2 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ acceptance: @if [ "${case}" != "" ]; then \ TF_ACC=true go test -parallel 1 -count 1 -run $(case) -v -timeout=20000s -cover $(ACC_TEST_FILE_LOCATION); \ else \ - TF_ACC=true go test -parallel 4 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ + TF_ACC=true go test -parallel 2 -v -timeout=50000s -cover $(ACC_TEST_FILE_LOCATION);\ fi build: vendor $(NAME) From c965c21ba481ae71a8e28f59d93899bceff016ab Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 16:58:17 +0530 Subject: [PATCH 07/13] update morpheus datastore --- internal/cmp/helper.go | 14 +++++++++----- internal/cmp/morpheus_datasource_broker.go | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/cmp/helper.go b/internal/cmp/helper.go index ad192da9..381f6185 100644 --- a/internal/cmp/helper.go +++ b/internal/cmp/helper.go @@ -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) { diff --git a/internal/cmp/morpheus_datasource_broker.go b/internal/cmp/morpheus_datasource_broker.go index f7319d56..bef005bc 100644 --- a/internal/cmp/morpheus_datasource_broker.go +++ b/internal/cmp/morpheus_datasource_broker.go @@ -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) From 7cbfe321b49a120bbb657dd0d4240aea70413478 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Mon, 4 Nov 2024 17:04:08 +0530 Subject: [PATCH 08/13] increase timeout for network --- internal/cmp/resource_network.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmp/resource_network.go b/internal/cmp/resource_network.go index a5411332..35c3da1d 100644 --- a/internal/cmp/resource_network.go +++ b/internal/cmp/resource_network.go @@ -117,9 +117,9 @@ func (r *resNetwork) Create(ctx context.Context, d *utils.Data, meta interface{} } errCount := 0 cRetry := utils.CustomRetry{ - Timeout: time.Minute * 10, + Timeout: time.Minute * 15, RetryDelay: time.Second * 10, - InitialDelay: time.Second * 10, + InitialDelay: time.Second * 20, Cond: func(response interface{}, err error) (bool, error) { if err != nil { errCount++ From ad9dd4105349e6df1d17e2d37ddd3006eedab3e1 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Tue, 5 Nov 2024 11:07:49 +0530 Subject: [PATCH 09/13] cleanup --- go.mod | 2 +- go.sum | 2 ++ pkg/utils/meta.go | 19 +++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ebad34b7..c4249a4a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.21 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0 github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 diff --git a/go.sum b/go.sum index f45b74e2..f381ab9d 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 h1:W4U6n4DNm+6TcBHEPh2/KaWkb8jPWOBLsIUkUZqY9Mg= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0 h1:L0HOYrKmsCqssIiBZTYhaIQ9Vr8uqZo7g84oh7zsdPo= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= diff --git a/pkg/utils/meta.go b/pkg/utils/meta.go index 3d4bc6df..9eb6ca2d 100644 --- a/pkg/utils/meta.go +++ b/pkg/utils/meta.go @@ -58,16 +58,7 @@ func SetCMPVars(apiClient, brokerClient *client.APIClient, cfg *client.Configura return } apiClient.SetHost(cmpDetails.URL) - ctx := context.Background() - ctx = context.WithValue(ctx, client.ContextAccessToken, cmpDetails.AccessToken) - err = apiClient.SetCMPVersion(ctx) - if err != nil { - log.Printf("[ERROR] Unable to set CMP version client: %s", err) - return - } - cfg.Host = cmpDetails.URL - - apiClient.SetCMPMeta(nil, brokerClient, func(ctx *context.Context, meta interface{}) { + apiClient.SetMetaFnAndVersion(nil, 0, func(ctx *context.Context, meta interface{}) { // Initialise token handler cmpDetails, err := brokerClient.GetCMPDetails(*ctx) if err != nil { @@ -76,6 +67,14 @@ func SetCMPVars(apiClient, brokerClient *client.APIClient, cfg *client.Configura *ctx = context.WithValue(*ctx, client.ContextAccessToken, cmpDetails.AccessToken) } }) + ctx := context.Background() + ctx = context.WithValue(ctx, client.ContextAccessToken, cmpDetails.AccessToken) + err = apiClient.SetCMPVersion(ctx) + if err != nil { + log.Printf("[ERROR] Unable to set CMP version client: %s", err) + return + } + cfg.Host = cmpDetails.URL return err } From dc82fc631898b4b7971e4a6353bd3e0e39695939 Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Tue, 5 Nov 2024 11:13:31 +0530 Subject: [PATCH 10/13] update atf helper.go --- internal/acceptance_test/helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/acceptance_test/helper.go b/internal/acceptance_test/helper.go index d979127f..3505caee 100644 --- a/internal/acceptance_test/helper.go +++ b/internal/acceptance_test/helper.go @@ -61,7 +61,7 @@ func getAPIClient() (*api_client.APIClient, api_client.Configuration) { DefaultQueryParams: map[string]string{}, } cmpAPIClient := api_client.NewAPIClient(&cfg) - cmpAPIClient.SetCMPMeta(nil, brokerClient, func(ctx *context.Context, meta interface{}) { + cmpAPIClient.SetMetaFnAndVersion(nil, 0, func(ctx *context.Context, meta interface{}) { // Initialise token handler cmpDetails, err := brokerClient.GetCMPDetails(*ctx) if err != nil { From 8549e0dce07c1e2200877ff5b0c4befeaa7dddae Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Tue, 5 Nov 2024 12:01:24 +0530 Subject: [PATCH 11/13] check provider-lib v0.0.21 --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c4249a4a..454d2c58 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hewlettpackard/hpegl-provider-lib v0.0.17 + github.com/hewlettpackard/hpegl-provider-lib v0.0.21 github.com/spf13/viper v1.18.2 github.com/tidwall/gjson v1.14.1 github.com/tshihad/tftags v0.0.10 diff --git a/go.sum b/go.sum index f381ab9d..a51c4d0c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383 h1:W4U6n4DNm+6TcBHEPh2/KaWkb8jPWOBLsIUkUZqY9Mg= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241031081330-09bdd6eaa383/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0 h1:L0HOYrKmsCqssIiBZTYhaIQ9Vr8uqZo7g84oh7zsdPo= github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -126,8 +124,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hewlettpackard/hpegl-provider-lib v0.0.17 h1:6sh4XjWK2hg2q5V78W4AypV0IBbDy0CpGoMfzE1CK1c= -github.com/hewlettpackard/hpegl-provider-lib v0.0.17/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= +github.com/hewlettpackard/hpegl-provider-lib v0.0.21 h1:35cmYg/UceVtxZHDMCKcEeAGhdJ5rzWi7JRrY/hS0BY= +github.com/hewlettpackard/hpegl-provider-lib v0.0.21/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= From e50b75fbde6a750da78af5f0b0f64ae01b3e5a2b Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Tue, 5 Nov 2024 12:26:30 +0530 Subject: [PATCH 12/13] check provider-lib v0.0.17 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 454d2c58..c4249a4a 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hewlettpackard/hpegl-provider-lib v0.0.21 + github.com/hewlettpackard/hpegl-provider-lib v0.0.17 github.com/spf13/viper v1.18.2 github.com/tidwall/gjson v1.14.1 github.com/tshihad/tftags v0.0.10 diff --git a/go.sum b/go.sum index a51c4d0c..e9b8c1d6 100644 --- a/go.sum +++ b/go.sum @@ -124,8 +124,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hewlettpackard/hpegl-provider-lib v0.0.21 h1:35cmYg/UceVtxZHDMCKcEeAGhdJ5rzWi7JRrY/hS0BY= -github.com/hewlettpackard/hpegl-provider-lib v0.0.21/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= +github.com/hewlettpackard/hpegl-provider-lib v0.0.17 h1:6sh4XjWK2hg2q5V78W4AypV0IBbDy0CpGoMfzE1CK1c= +github.com/hewlettpackard/hpegl-provider-lib v0.0.17/go.mod h1:Bw2DhefBjqXQI6s5vBBGiWUkFz7fx4KkbGfwmo9wv3U= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= From 93b02c48a14571587883837102c816fb8e10d0ce Mon Sep 17 00:00:00 2001 From: Mahesh N Date: Tue, 5 Nov 2024 14:17:01 +0530 Subject: [PATCH 13/13] update go-sdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c4249a4a..60babebc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.21 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14 github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 diff --git a/go.sum b/go.sum index e9b8c1d6..bc80f5ae 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0 h1:L0HOYrKmsCqssIiBZTYhaIQ9Vr8uqZo7g84oh7zsdPo= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14-0.20241105053431-8961e26004b0/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14 h1:G3i8N70LBGo1tEFXCCBx5fd+cERBvnBCviFheVLlj80= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.14/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=