Skip to content

Commit

Permalink
fix: remove unsupported PreferNoSchedule taint effect option
Browse files Browse the repository at this point in the history
  • Loading branch information
Laimonas Rastenis committed Sep 18, 2023
1 parent c390f18 commit 44816cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
11 changes: 5 additions & 6 deletions castai/resource_node_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ const (
)

const (
TaintEffectNoSchedule = "NoSchedule"
TaintEffectNoExecute = "NoExecute"
TaintEffectPreferNoSchedule = "PreferNoSchedule"
TaintEffectNoSchedule = "NoSchedule"
TaintEffectNoExecute = "NoExecute"
)

const (
Expand Down Expand Up @@ -353,9 +352,9 @@ func resourceNodeTemplate() *schema.Resource {
Type: schema.TypeString,
Default: TaintEffectNoSchedule,
ValidateDiagFunc: validation.ToDiagFunc(
validation.StringInSlice([]string{TaintEffectNoSchedule, TaintEffectNoExecute, TaintEffectPreferNoSchedule}, false),
validation.StringInSlice([]string{TaintEffectNoSchedule, TaintEffectNoExecute}, false),
),
Description: "Effect of a taint to be added to nodes created from this template.",
Description: fmt.Sprintf("Effect of a taint to be added to nodes created from this template, the default is %s. Allowed values: %s.", TaintEffectNoSchedule, strings.Join([]string{TaintEffectNoSchedule, TaintEffectNoExecute}, ", ")),
},
},
},
Expand Down Expand Up @@ -909,7 +908,7 @@ func flattenCustomTaints(taints *[]sdk.NodetemplatesV1Taint) []map[string]string
t[FieldValue] = toString(v)
}
if e := taint.Effect; e != nil {
t[FieldEffect] = toString(e)
t[FieldEffect] = string(*e)
}

ts = append(ts, t)
Expand Down
12 changes: 6 additions & 6 deletions castai/sdk/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/resources/node_template.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 44816cf

Please sign in to comment.