diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2785022..f63f9bc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,23 @@ updates: directory: '/' schedule: interval: 'weekly' + day: 'friday' + time: '06:00' + timezone: 'Australia/Perth' + groups: + minor-patch: + update-types: + - 'minor' + - 'patch' - package-ecosystem: 'gomod' directory: '/' schedule: interval: 'weekly' + day: 'friday' + time: '06:00' + timezone: 'Australia/Perth' + groups: + minor-patch: + update-types: + - 'minor' + - 'patch' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a7ab31b..70ba654 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,7 +35,7 @@ jobs: exit 1 fi - name: Run tests - run: go test -v -cover ./... + run: go test -v -cover ./internal/provider/... env: TF_ACC: '1' BINARYLANE_API_TOKEN: ${{ secrets.BINARYLANE_API_TOKEN }} diff --git a/internal/resources/server_firewall_rules_resource_gen.go b/internal/resources/server_firewall_rules_resource_gen.go index 13fb355..0724d9c 100644 --- a/internal/resources/server_firewall_rules_resource_gen.go +++ b/internal/resources/server_firewall_rules_resource_gen.go @@ -621,11 +621,19 @@ func (v FirewallRulesValue) String() string { func (v FirewallRulesValue) ToObjectValue(ctx context.Context) (basetypes.ObjectValue, diag.Diagnostics) { var diags diag.Diagnostics - destinationAddressesVal, d := types.ListValue(types.StringType, v.DestinationAddresses.Elements()) - - diags.Append(d...) + var destinationAddressesVal basetypes.ListValue + switch { + case v.DestinationAddresses.IsUnknown(): + destinationAddressesVal = types.ListUnknown(types.StringType) + case v.DestinationAddresses.IsNull(): + destinationAddressesVal = types.ListNull(types.StringType) + default: + var d diag.Diagnostics + destinationAddressesVal, d = types.ListValue(types.StringType, v.DestinationAddresses.Elements()) + diags.Append(d...) + } - if d.HasError() { + if diags.HasError() { return types.ObjectUnknown(map[string]attr.Type{ "action": basetypes.StringType{}, "description": basetypes.StringType{}, @@ -642,11 +650,19 @@ func (v FirewallRulesValue) ToObjectValue(ctx context.Context) (basetypes.Object }), diags } - destinationPortsVal, d := types.ListValue(types.StringType, v.DestinationPorts.Elements()) - - diags.Append(d...) + var destinationPortsVal basetypes.ListValue + switch { + case v.DestinationPorts.IsUnknown(): + destinationPortsVal = types.ListUnknown(types.StringType) + case v.DestinationPorts.IsNull(): + destinationPortsVal = types.ListNull(types.StringType) + default: + var d diag.Diagnostics + destinationPortsVal, d = types.ListValue(types.StringType, v.DestinationPorts.Elements()) + diags.Append(d...) + } - if d.HasError() { + if diags.HasError() { return types.ObjectUnknown(map[string]attr.Type{ "action": basetypes.StringType{}, "description": basetypes.StringType{}, @@ -663,11 +679,19 @@ func (v FirewallRulesValue) ToObjectValue(ctx context.Context) (basetypes.Object }), diags } - sourceAddressesVal, d := types.ListValue(types.StringType, v.SourceAddresses.Elements()) - - diags.Append(d...) + var sourceAddressesVal basetypes.ListValue + switch { + case v.SourceAddresses.IsUnknown(): + sourceAddressesVal = types.ListUnknown(types.StringType) + case v.SourceAddresses.IsNull(): + sourceAddressesVal = types.ListNull(types.StringType) + default: + var d diag.Diagnostics + sourceAddressesVal, d = types.ListValue(types.StringType, v.SourceAddresses.Elements()) + diags.Append(d...) + } - if d.HasError() { + if diags.HasError() { return types.ObjectUnknown(map[string]attr.Type{ "action": basetypes.StringType{}, "description": basetypes.StringType{},