Skip to content

Commit

Permalink
PLT-822: Fixing issue with default values and validation function.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikchern committed Dec 11, 2023
1 parent 2034317 commit 72d3f4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion spectrocloud/resource_cluster_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ func resourceClusterAzure() *schema.Resource {
Type: schema.TypeString,
},
Description: "Availability zones for the machine pool. Check if your region provides availability zones on [the Azure documentation](https://learn.microsoft.com/en-us/azure/reliability/availability-zones-service-support#azure-regions-with-availability-zone-support). Default value is `[\"\"]`.",
Default: []string{""},
DefaultFunc: func() (any, error) {
return []string{""}, nil
},
},
"is_system_node_pool": {
Type: schema.TypeBool,
Expand Down
6 changes: 4 additions & 2 deletions spectrocloud/resource_cluster_azure_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package spectrocloud

import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/spectrocloud/hapi/models"
"github.com/spectrocloud/palette-sdk-go/client"
"github.com/spectrocloud/terraform-provider-spectrocloud/types"
"github.com/stretchr/testify/assert"
"testing"

"github.com/spectrocloud/terraform-provider-spectrocloud/types"
)

func prepareAzureTestData() *schema.ResourceData {
Expand Down
9 changes: 4 additions & 5 deletions spectrocloud/resource_cluster_edge_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ func resourceClusterEdgeNative() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ssh_keys": {
Type: schema.TypeSet,
Optional: true,
Set: schema.HashString,
ConflictsWith: []string{"cloud_config.0.ssh_key"},
Type: schema.TypeSet,
Optional: true,
Set: schema.HashString,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "List of SSH (Secure Shell) to establish, administer, and communicate with remote clusters, `ssh_key & ssh_keys` are mutually exclusive.",
Description: "List of SSH (Secure Shell) to establish, administer, and communicate with remote clusters.",
},
"vip": {
Type: schema.TypeString,
Expand Down

0 comments on commit 72d3f4a

Please sign in to comment.