From d9facffb5f46a9ac7d6e66c4aa6583f1d2dc0ee5 Mon Sep 17 00:00:00 2001 From: Matt Trachier Date: Fri, 6 Sep 2024 13:18:49 -0500 Subject: [PATCH] fix: remove extra return in machine template, back port v5 (#1400) (#1401) --- rancher2/resource_rancher2_machine_config_v2.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rancher2/resource_rancher2_machine_config_v2.go b/rancher2/resource_rancher2_machine_config_v2.go index eae69f73..2b238ad1 100644 --- a/rancher2/resource_rancher2_machine_config_v2.go +++ b/rancher2/resource_rancher2_machine_config_v2.go @@ -60,10 +60,6 @@ func waitForMachineConfigV2(d *schema.ResourceData, config *Config, interval tim return nil } log.Printf("[INFO] Retrying on error Refreshing Machine Config V2 %s: %v", d.Id(), err) - if IsNotFound(err) || IsForbidden(err) { - d.SetId("") - return fmt.Errorf("Machine Config V2 %s not found: %s", d.Id(), err) - } if IsNotAccessibleByID(err) { // Restarting clients to update RBAC config.RestartClients() @@ -72,6 +68,7 @@ func waitForMachineConfigV2(d *schema.ResourceData, config *Config, interval tim select { case <-time.After(rancher2RetriesWait * time.Second): case <-ctx.Done(): + d.SetId("") return fmt.Errorf("Timeout waiting for machine config V2 ID %s", d.Id()) } }