Skip to content

Commit 09e236b

Browse files
lots0logsCopilot
andauthored
Update rancher2/resource_rancher2_machine_config_v2.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 471213d commit 09e236b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

rancher2/resource_rancher2_machine_config_v2.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ func resourceRancher2MachineConfigV2() *schema.Resource {
3535

3636
if useInterfaces {
3737
subnetID, ok := cfg["vpc_subnet_id"].(string)
38-
if !ok {
39-
// Value is unknown; skip validation to avoid false positives.
40-
return nil
41-
}
42-
if strings.TrimSpace(subnetID) == "" {
38+
// Treat missing or non-string values as empty to ensure validation
39+
if !ok || strings.TrimSpace(subnetID) == "" {
4340
return fmt.Errorf("linode_config.0.vpc_subnet_id must be set when linode_config.0.use_interfaces is true")
4441
}
4542
} else {

0 commit comments

Comments
 (0)