Skip to content

Commit e147c5b

Browse files
authored
fix(k8s): validate cni field against full list of allowed values (#3375)
1 parent 00dcf7f commit e147c5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/services/k8s/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ func ResourceCluster() *schema.Resource {
6969
ForceNew: true,
7070
Description: "The CNI plugin of the cluster",
7171
ValidateDiagFunc: func(i any, p cty.Path) diag.Diagnostics {
72-
var cniValues []k8s.CNI
72+
cniValues := k8s.CNI("").Values()
7373

74-
cniStringValues := []string(nil)
74+
cniStringValues := make([]string, 0, len(cniValues))
7575
for _, cniValue := range cniValues {
7676
cniStringValues = append(cniStringValues, cniValue.String())
7777
}

0 commit comments

Comments
 (0)