Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
  • Loading branch information
linkas45 committed Feb 19, 2024
1 parent 8a5049d commit 3295cb6
Showing 1 changed file with 8 additions and 6 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

0 comments on commit 3295cb6

Please sign in to comment.