You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(k8s): add warning if cluster type is not prefixed by kapsule or multicloud (#2309)
* feat(k8s): add warning if cluster type is not prefixed by kapsule or multicloud
* add attributepath to diag
* remove usage of slices package
---------
Co-authored-by: Pablo RUTH <[email protected]>
Detail: fmt.Sprintf("The expected cluster type is one of %v, but got %s", []string{"kapsule", "multicloud", "kapsule-dedicated-*", "multicloud-dedicated-*"}, clusterType.(string)),
342
+
AttributePath: cty.GetAttrPath("type"),
343
+
})
344
+
}
345
+
338
346
req:=&k8s.CreateClusterRequest{
339
347
Region: region,
340
348
ProjectID: expandStringPtr(d.Get("project_id")),
@@ -441,7 +449,7 @@ func resourceScalewayK8SClusterCreate(ctx context.Context, d *schema.ResourceDat
441
449
// if one auto upgrade attribute is set, they all must be set.
442
450
// if none is set, auto upgrade attributes will be computed.
443
451
if!(okAutoUpgradeDay&&okAutoUpgradeStartHour) {
444
-
returndiag.FromErr(fmt.Errorf("all field or zero field of auto_upgrade must be set"))
452
+
returnappend(diag.FromErr(fmt.Errorf("all field or zero field of auto_upgrade must be set")), diags...)
445
453
}
446
454
}
447
455
@@ -464,13 +472,13 @@ func resourceScalewayK8SClusterCreate(ctx context.Context, d *schema.ResourceDat
Detail: fmt.Sprintf("The expected cluster type is one of %v, but got %s", []string{"kapsule", "multicloud", "kapsule-dedicated-*", "multicloud-dedicated-*"}, d.Get("type").(string)),
635
+
AttributePath: cty.GetAttrPath("type"),
636
+
})
637
+
}
638
+
620
639
canUpgrade:=false
621
640
622
641
////
@@ -674,13 +693,13 @@ func resourceScalewayK8SClusterUpdate(ctx context.Context, d *schema.ResourceDat
0 commit comments