Skip to content

Commit

Permalink
go fumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
bwJuniper committed Oct 21, 2024
1 parent 5b61908 commit 9dcdfda
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 43 deletions.
1 change: 1 addition & 0 deletions apstra/blueprint/datacenter_property_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package blueprint

import (
"context"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand Down
7 changes: 4 additions & 3 deletions apstra/blueprint/datacenter_routing_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ package blueprint
import (
"context"
"fmt"
"net"
"regexp"
"strings"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/constants"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
Expand All @@ -21,9 +25,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"net"
"regexp"
"strings"
)

type DatacenterRoutingPolicy struct {
Expand Down
1 change: 1 addition & 0 deletions apstra/blueprint/nodes_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package blueprint

import (
"context"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand Down
3 changes: 2 additions & 1 deletion apstra/blueprint/prefix_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package blueprint
import (
"context"
"fmt"
"net"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"net"
)

type prefixFilter struct {
Expand Down
3 changes: 2 additions & 1 deletion apstra/blueprint/rack.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package blueprint

import (
"context"
"strings"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
"github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator"
Expand All @@ -14,7 +16,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"strings"
)

type Rack struct {
Expand Down
3 changes: 2 additions & 1 deletion apstra/connectivity_template/custom_static_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"net"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"net"
)

var _ Primitive = &CustomStaticRoute{}
Expand Down
7 changes: 4 additions & 3 deletions apstra/connectivity_template/dynamic_bgp_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"crypto/sha1"
"encoding/json"
"fmt"
"math"
"net"
"sort"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand All @@ -18,9 +22,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"math"
"net"
"sort"
)

var _ Primitive = &DynamicBgpPeering{}
Expand Down
3 changes: 2 additions & 1 deletion apstra/connectivity_template/static_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"context"
"encoding/json"
"fmt"
"net"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"net"
)

var _ Primitive = &StaticRoute{}
Expand Down
1 change: 1 addition & 0 deletions apstra/connectivity_template/vn_multiple.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand Down
7 changes: 5 additions & 2 deletions apstra/data_source_datacenter_external_gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tfapstra
import (
"context"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/blueprint"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
Expand All @@ -16,8 +17,10 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
)

var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterExternalGateways{}
var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterExternalGateways{}
var (
_ datasource.DataSourceWithConfigure = &dataSourceDatacenterExternalGateways{}
_ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterExternalGateways{}
)

type dataSourceDatacenterExternalGateways struct {
getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error)
Expand Down
7 changes: 5 additions & 2 deletions apstra/data_source_datacenter_routing_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tfapstra
import (
"context"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/blueprint"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
Expand All @@ -16,8 +17,10 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
)

var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterRoutingPolicies{}
var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterRoutingPolicies{}
var (
_ datasource.DataSourceWithConfigure = &dataSourceDatacenterRoutingPolicies{}
_ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterRoutingPolicies{}
)

type dataSourceDatacenterRoutingPolicies struct {
getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error)
Expand Down
8 changes: 5 additions & 3 deletions apstra/data_source_datacenter_security_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tfapstra
import (
"context"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/blueprint"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
Expand All @@ -17,8 +18,10 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
)

var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterSecurityPolicies{}
var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterSecurityPolicies{}
var (
_ datasource.DataSourceWithConfigure = &dataSourceDatacenterSecurityPolicies{}
_ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterSecurityPolicies{}
)

type dataSourceDatacenterSecurityPolicies struct {
getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error)
Expand Down Expand Up @@ -125,7 +128,6 @@ func (o *dataSourceDatacenterSecurityPolicies) Read(ctx context.Context, req dat

// set the state
resp.Diagnostics.Append(resp.State.Set(ctx, &config)...)

}

func (o *dataSourceDatacenterSecurityPolicies) getAllSpIds(ctx context.Context, bp *apstra.TwoStageL3ClosClient, diags *diag.Diagnostics) []attr.Value {
Expand Down
9 changes: 6 additions & 3 deletions apstra/data_source_datacenter_virtual_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package tfapstra
import (
"context"
"fmt"
"net"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/blueprint"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
Expand All @@ -17,11 +19,12 @@ import (
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"net"
)

var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterVirtualNetworks{}
var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterVirtualNetworks{}
var (
_ datasource.DataSourceWithConfigure = &dataSourceDatacenterVirtualNetworks{}
_ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterVirtualNetworks{}
)

type dataSourceDatacenterVirtualNetworks struct {
getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error)
Expand Down
1 change: 1 addition & 0 deletions apstra/design/property_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package design

import (
"context"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand Down
1 change: 1 addition & 0 deletions apstra/design/rack_type_esi_lag_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package design

import (
"context"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
Expand Down
6 changes: 4 additions & 2 deletions apstra/design/rack_type_leaf_switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package design
import (
"context"
"fmt"
"strings"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
Expand All @@ -17,7 +19,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"strings"
)

func ValidateLeafSwitch(rt *apstra.RackType, i int, diags *diag.Diagnostics) {
Expand Down Expand Up @@ -325,5 +326,6 @@ func NewLeafSwitchMap(ctx context.Context, in []apstra.RackElementLeafSwitch, fc
func LeafRedundancyModes() []string {
return []string{
apstra.LeafRedundancyProtocolEsi.String(),
apstra.LeafRedundancyProtocolMlag.String()}
apstra.LeafRedundancyProtocolMlag.String(),
}
}
4 changes: 3 additions & 1 deletion apstra/design/rack_type_mlag_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package design

import (
"context"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
Expand Down Expand Up @@ -130,7 +131,8 @@ func (o MlagInfo) AttrTypes() map[string]attr.Type {
"peer_link_port_channel_id": types.Int64Type,
"l3_peer_link_count": types.Int64Type,
"l3_peer_link_speed": types.StringType,
"l3_peer_link_port_channel_id": types.Int64Type}
"l3_peer_link_port_channel_id": types.Int64Type,
}
}

func (o *MlagInfo) LoadApiData(_ context.Context, in *apstra.LeafMlagInfo, diags *diag.Diagnostics) {
Expand Down
1 change: 1 addition & 0 deletions apstra/design/template_collapsed.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package design
import (
"context"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator"
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package apstraplanmodifier

import (
"context"

"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
)
Expand All @@ -26,4 +27,4 @@ func BoolRequiresReplaceWhenSwitchingTo(to bool) boolplanmodifier.RequiresReplac
}
}

//func requiresReplaceWhenSwitchingTo() func(context.Context, planmodifier.BoolRequest, *RequiresReplaceIfFuncResponse)
// func requiresReplaceWhenSwitchingTo() func(context.Context, planmodifier.BoolRequest, *RequiresReplaceIfFuncResponse)
1 change: 1 addition & 0 deletions apstra/validator/also_requires_n_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package apstravalidator
import (
"context"
"fmt"

"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
Expand Down
3 changes: 2 additions & 1 deletion apstra/validator/at_least_product_of.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package apstravalidator
import (
"context"
"fmt"
"math/big"

"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"math/big"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion apstra/validator/attribute_conflict.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"context"
"encoding/base64"
"fmt"
"strings"

"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"strings"
)

type CollectionValidator interface {
Expand Down
5 changes: 3 additions & 2 deletions apstra/validator/attribute_conflict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package apstravalidator

import (
"context"
"log"
"testing"

"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"log"
"testing"
)

func TestAttributeConflictValidator(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions apstra/validator/different_from.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package apstravalidator
import (
"context"
"fmt"

"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
Expand Down
1 change: 1 addition & 0 deletions apstra/validator/different_from_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package apstravalidator
import (
"context"
"fmt"

"github.com/Juniper/terraform-provider-apstra/apstra/utils"
"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down
1 change: 1 addition & 0 deletions apstra/validator/exactly_one_binding_when_vn_type_vlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package apstravalidator
import (
"context"
"fmt"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
Expand Down
Loading

0 comments on commit 9dcdfda

Please sign in to comment.