From 69bd72a3b98ae40e60a2c19211aeb296c4020c3f Mon Sep 17 00:00:00 2001 From: Samsondeen Dare Date: Tue, 22 Oct 2024 16:42:57 +0200 Subject: [PATCH] fix missing method error --- internal/provider/client_mock_workspaces_test.go | 4 ++++ internal/provider/resource_tfe_no_code_module.go | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/provider/client_mock_workspaces_test.go b/internal/provider/client_mock_workspaces_test.go index 753ea5287..764b922eb 100644 --- a/internal/provider/client_mock_workspaces_test.go +++ b/internal/provider/client_mock_workspaces_test.go @@ -196,3 +196,7 @@ func (m *mockWorkspaces) SetDataRetentionPolicyDeleteOlder(ctx context.Context, func (m *mockWorkspaces) SetDataRetentionPolicyDontDelete(ctx context.Context, organization string, options tfe.DataRetentionPolicyDontDeleteSetOptions) (*tfe.DataRetentionPolicyDontDelete, error) { panic("not implemented") } + +func (m *mockWorkspaces) ListTagBindings(ctx context.Context, workspaceID string) ([]*tfe.TagBinding, error) { + panic("not implemented") +} diff --git a/internal/provider/resource_tfe_no_code_module.go b/internal/provider/resource_tfe_no_code_module.go index 01073b5c6..39c4e76db 100644 --- a/internal/provider/resource_tfe_no_code_module.go +++ b/internal/provider/resource_tfe_no_code_module.go @@ -158,8 +158,8 @@ func variableOptionsMaptoStruct(variableOptions []interface{}) []*tfe.NoCodeVari return variableOptionsRes } -func getFullModuleID(ctx context.Context, client *tfe.Client, orgName, ID string) (tfe.RegistryModuleID, error) { - module, err := client.RegistryModules.Read(ctx, tfe.RegistryModuleID{ID: ID}) +func getFullModuleID(ctx context.Context, client *tfe.Client, orgName, id string) (tfe.RegistryModuleID, error) { + module, err := client.RegistryModules.Read(ctx, tfe.RegistryModuleID{ID: id}) if err != nil { return tfe.RegistryModuleID{}, err } @@ -176,8 +176,8 @@ func waitForModuleVersion(ctx context.Context, client *tfe.Client, moduleID tfe. timeout := time.Duration(5) * time.Minute return retry.RetryContext(ctx, timeout, func() *retry.RetryError { _, err := client.RegistryModules.ReadVersion(ctx, moduleID, versionPin) - if err == tfe.ErrResourceNotFound { - return retry.RetryableError(fmt.Errorf("Version %s not found for module %s", versionPin, moduleID)) + if errors.Is(err, tfe.ErrResourceNotFound) { + return retry.RetryableError(fmt.Errorf("version %s not found for module %s", versionPin, moduleID)) } if err != nil { return retry.NonRetryableError(err)