Skip to content

Commit

Permalink
revert spot attributes validation from node templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Solecki committed Aug 23, 2024
1 parent 21c1f43 commit fab1d21
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 30 deletions.
16 changes: 6 additions & 10 deletions castai/resource_node_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,9 @@ func resourceNodeTemplate() *schema.Resource {
Description: "Spot instance fallback constraint - when true, on-demand instances will be created, when spots are unavailable.",
},
FieldNodeTemplateFallbackRestoreRateSeconds: {
Type: schema.TypeInt,
Default: 1800,
Optional: true,
Description: "Fallback restore rate in seconds: defines how much time should pass before spot fallback should be attempted to be restored to real spot.",
ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(60)),
Type: schema.TypeInt,
Optional: true,
Description: "Fallback restore rate in seconds: defines how much time should pass before spot fallback should be attempted to be restored to real spot.",
},
FieldNodeTemplateEnableSpotDiversity: {
Type: schema.TypeBool,
Expand All @@ -219,11 +217,9 @@ func resourceNodeTemplate() *schema.Resource {
Description: "Enable/disable spot diversity policy. When enabled, autoscaler will try to balance between diverse and cost optimal instance types.",
},
FieldNodeTemplateSpotDiversityPriceIncreaseLimitPercent: {
Type: schema.TypeInt,
Optional: true,
Default: 20,
Description: "Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the optimal configuration.",
ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(1)),
Type: schema.TypeInt,
Optional: true,
Description: "Allowed node configuration price increase when diversifying instance types. E.g. if the value is 10%, then the overall price of diversified instance types can be 10% higher than the price of the optimal configuration.",
},
FieldNodeTemplateSpotInterruptionPredictionsEnabled: {
Type: schema.TypeBool,
Expand Down
6 changes: 0 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.

159 changes: 149 additions & 10 deletions castai/sdk/client.gen.go

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

43 changes: 39 additions & 4 deletions castai/sdk/mock/client.go

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

0 comments on commit fab1d21

Please sign in to comment.