Skip to content

Commit

Permalink
fix: remove extra return in machine template (#1400)
Browse files Browse the repository at this point in the history
Signed-off-by: matttrach <[email protected]>
(cherry picked from commit 1792a32)
  • Loading branch information
matttrach committed Sep 6, 2024
1 parent 3b295bf commit 2c3ca3f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rancher2/resource_rancher2_machine_config_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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())
}
}
Expand Down

0 comments on commit 2c3ca3f

Please sign in to comment.