Skip to content

Commit

Permalink
Fix is_enabled property in node template (#273)
Browse files Browse the repository at this point in the history
* impl

* update sdk
  • Loading branch information
linkas45 authored Feb 19, 2024
1 parent 8a5049d commit 83f10b8
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 199 deletions.
14 changes: 8 additions & 6 deletions castai/resource_node_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package castai
import (
"context"
"fmt"
"github.com/castai/terraform-provider-castai/castai/sdk"
"log"
"strings"
"time"

"github.com/google/uuid"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/samber/lo"
"log"
"strings"
"time"

"github.com/castai/terraform-provider-castai/castai/sdk"
)

const (
Expand Down Expand Up @@ -600,11 +602,11 @@ func updateNodeTemplate(ctx context.Context, d *schema.ResourceData, meta any, s
name := d.Get(FieldNodeTemplateName).(string)

req := sdk.NodeTemplatesAPIUpdateNodeTemplateJSONRequestBody{}
if v, ok := d.GetOk(FieldNodeTemplateIsDefault); ok {
if v, _ := d.GetOk(FieldNodeTemplateIsDefault); v != nil {
req.IsDefault = toPtr(v.(bool))
}

if v, ok := d.GetOk(FieldNodeTemplateIsEnabled); ok {
if v, _ := d.GetOk(FieldNodeTemplateIsEnabled); v != nil {
req.IsEnabled = toPtr(v.(bool))
}

Expand Down
93 changes: 52 additions & 41 deletions castai/sdk/api.gen.go

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

117 changes: 0 additions & 117 deletions castai/sdk/client.gen.go

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

Loading

0 comments on commit 83f10b8

Please sign in to comment.