Skip to content

Commit ef5311a

Browse files
authored
validation check for CNI and cluster type (#362)
1 parent 419ca85 commit ef5311a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: civo/kubernetes/resource_kubernetes_cluster.go

+7
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,13 @@ func resourceKubernetesClusterDelete(ctx context.Context, d *schema.ResourceData
518518

519519
func customizeDiffKubernetesCluster(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error {
520520

521+
// Check if cluster type is talos and CNI is cilium
522+
if clusterType, ok := d.GetOk("cluster_type"); ok && clusterType.(string) == "talos" {
523+
if cni, ok := d.GetOk("cni"); ok && cni.(string) == "cilium" {
524+
return fmt.Errorf("cilium CNI is not supported with Talos cluster type. Please use flannel CNI instead")
525+
}
526+
}
527+
521528
// Check if kubernetes version string is correct
522529
if kubeVersion, ok := d.GetOk("kubernetes_version"); ok {
523530
version := kubeVersion.(string)

0 commit comments

Comments
 (0)