Skip to content

Commit

Permalink
feat: relaxing case restriction for redundancy Type.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdhulipala committed Feb 23, 2025
1 parent ed852bc commit bf9b6bf
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions equinix/resource_network_device_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package equinix
import (
"context"
"fmt"
"strings"
"time"

"github.com/equinix/terraform-provider-equinix/internal/config"
Expand Down Expand Up @@ -106,7 +107,7 @@ func resourceNetworkDeviceLink() *schema.Resource {
UpdateContext: resourceNetworkDeviceLinkUpdate,
DeleteContext: resourceNetworkDeviceLinkDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
StateContext: schema.ImportStatePassthroughContext,
},
Schema: createNetworkDeviceLinkResourceSchema(),
Timeouts: &schema.ResourceTimeout{
Expand Down Expand Up @@ -154,8 +155,12 @@ func createNetworkDeviceLinkResourceSchema() map[string]*schema.Schema {
Optional: true,
ForceNew: true,
Default: "PRIMARY",
ValidateFunc: validation.StringInSlice([]string{"PRIMARY", "SECONDARY", "HYBRID"}, false),
Description: networkDeviceLinkDescriptions["RedundancyType"],
ValidateFunc: validation.StringInSlice([]string{"PRIMARY", "SECONDARY", "HYBRID"}, true),
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {

Check failure on line 159 in equinix/resource_network_device_link.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'k' seems to be unused, consider removing or renaming it as _ (revive)
println("old value and new value")
return old == strings.ToUpper(new)
},
Description: networkDeviceLinkDescriptions["RedundancyType"],
},
networkDeviceLinkSchemaNames["Devices"]: {
Type: schema.TypeSet,
Expand Down Expand Up @@ -322,7 +327,7 @@ func resourceNetworkDeviceLinkCreate(ctx context.Context, d *schema.ResourceData
return diags
}

func resourceNetworkDeviceLinkRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceNetworkDeviceLinkRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
client := m.(*config.Config).Ne
m.(*config.Config).AddModuleToNEUserAgent(&client, d)
var diags diag.Diagnostics
Expand Down Expand Up @@ -481,7 +486,7 @@ func expandNetworkDeviceLinkDevices(devices *schema.Set) []ne.DeviceLinkGroupDev
return transformed
}

func flattenNetworkDeviceLinkDevices(currentDevices *schema.Set, devices []ne.DeviceLinkGroupDevice) interface{} {
func flattenNetworkDeviceLinkDevices(_ *schema.Set, devices []ne.DeviceLinkGroupDevice) interface{} {
transformed := make([]interface{}, 0, len(devices))
for i := range devices {
transformedDevice := map[string]interface{}{
Expand Down

0 comments on commit bf9b6bf

Please sign in to comment.