Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Run Acceptance Tests
run: go test -v ./internal/services/${{ matrix.products }} -timeout=2h
env:
Expand All @@ -76,7 +76,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
- name: Run scwconfig tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- docs/**

env:
GO_VERSION: "1.23.5"
GO_VERSION: "1.24.0"
GO111MODULE: on

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Run Acceptance Tests
run: go test -v ./internal/services/${{ matrix.products }} -timeout=4h
env:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
- name: Run sweepers
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/purge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Manual Purge
on:
workflow_dispatch:

jobs:
sweeper:
runs-on: ubuntu-latest
steps:
# Checkout should always be before setup-go to ensure caching is working
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24.0
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
- name: Run sweepers
run: make sweep
env:
TF_TEST_DOMAIN: scaleway-terraform.com
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0

- name: Import GPG key
id: import_gpg
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tfproviderlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Install tfproviderlint
run: go install github.com/bflad/tfproviderlint/cmd/tfproviderlint
- name: Run tfproviderlint
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- uses: hashicorp/setup-terraform@v3
- run: go install github.com/bflad/tfproviderdocs@latest
- run: make tfproviderdocs
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.23.5
go-version: 1.24.0
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
- name: Build binaries
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/scaleway/terraform-provider-scaleway/v2

go 1.23.5
go 1.24.0

require (
github.com/aws/aws-sdk-go-v2 v1.36.0
Expand Down
3 changes: 1 addition & 2 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package acctest

import (
"context"
"os"
"strconv"
"strings"
Expand All @@ -27,7 +26,7 @@ type TestTools struct {
func NewTestTools(t *testing.T) *TestTools {
t.Helper()

ctx := context.Background()
ctx := t.Context()

folder, err := os.Getwd()
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package provider_test

import (
"context"
"fmt"
"testing"

Expand All @@ -20,7 +19,7 @@ func TestAccProvider_InstanceIPZones(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down Expand Up @@ -78,7 +77,7 @@ func TestAccProvider_SSHKeys(t *testing.T) {
SSHKeyName := "TestAccScalewayProvider_SSHKeys"
SSHKey := "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEEYrzDOZmhItdKaDAEqJQ4ORS2GyBMtBozYsK5kiXXX [email protected]"

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down
2 changes: 1 addition & 1 deletion internal/services/cockpit/plan_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func DataSourceCockpitPlanRead(ctx context.Context, d *schema.ResourceData, m in

name := d.Get("name").(string)

res, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) //nolint:staticcheck
res, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages())
if err != nil {
return diag.FromErr(err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func ResourceContainerUpdate(ctx context.Context, d *schema.ResourceData, m inte
}

if d.HasChanges("max_concurrency") {
req.MaxConcurrency = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int))) //nolint:staticcheck
req.MaxConcurrency = scw.Uint32Ptr(uint32(d.Get("max_concurrency").(int)))
}

if d.HasChanges("protocol") {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/container/helpers_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func setCreateContainerRequest(d *schema.ResourceData, region scw.Region) (*cont
}

if maxConcurrency, ok := d.GetOk("max_concurrency"); ok {
req.MaxConcurrency = scw.Uint32Ptr(uint32(maxConcurrency.(int))) //nolint:staticcheck
req.MaxConcurrency = scw.Uint32Ptr(uint32(maxConcurrency.(int)))
}

if sandbox, ok := d.GetOk("sandbox"); ok {
Expand Down
15 changes: 7 additions & 8 deletions internal/services/iam/policy_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package iam_test

import (
"context"
"fmt"
"testing"

Expand All @@ -18,7 +17,7 @@ func TestAccPolicy_Basic(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -92,7 +91,7 @@ func TestAccPolicy_NoUpdate(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -155,7 +154,7 @@ func TestAccPolicy_ChangeLinkedEntity(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -261,7 +260,7 @@ func TestAccPolicy_ChangePermissions(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -352,7 +351,7 @@ func TestAccPolicy_ProjectID(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -418,7 +417,7 @@ func TestAccPolicy_Condition(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down Expand Up @@ -513,7 +512,7 @@ func TestAccPolicy_ChangeRulePrincipal(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
require.NoError(t, err)

Expand Down
8 changes: 4 additions & 4 deletions internal/services/instance/servers_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ func DataSourceInstanceServersRead(ctx context.Context, d *schema.ResourceData,
rawServer["placement_group_policy_respected"] = server.PlacementGroup.PolicyRespected
}

if server.IPv6 != nil { //nolint:staticcheck
rawServer["ipv6_address"] = server.IPv6.Address.String() //nolint:staticcheck
rawServer["ipv6_gateway"] = server.IPv6.Gateway.String() //nolint:staticcheck
if server.IPv6 != nil {
rawServer["ipv6_address"] = server.IPv6.Address.String()
rawServer["ipv6_gateway"] = server.IPv6.Gateway.String()

prefixLength, err := strconv.Atoi(server.IPv6.Netmask) //nolint:staticcheck
prefixLength, err := strconv.Atoi(server.IPv6.Netmask)
if err != nil {
diags = append(diags, diag.FromErr(fmt.Errorf("failed to read ipv6 netmask: %w", err))...)

Expand Down
2 changes: 1 addition & 1 deletion internal/services/instance/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func flattenImageExtraVolumes(volumes map[string]*instance.Volume, zone scw.Zone
volumeFlat := map[string]interface{}{
"id": zonal.NewIDString(zone, volume.ID),
"name": volume.Name,
"export_uri": volume.ExportURI, //nolint:staticcheck
"export_uri": volume.ExportURI,
"size": volume.Size,
"volume_type": volume.VolumeType,
"creation_date": volume.CreationDate,
Expand Down
3 changes: 1 addition & 2 deletions internal/services/lb/lb_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lb_test

import (
"context"
"errors"
"fmt"
"reflect"
Expand Down Expand Up @@ -692,7 +691,7 @@ func TestLbUpgradeV1SchemaUpgradeFunc(t *testing.T) {
"id": "fr-par-1/22c61530-834c-4ab4-aa71-aaaa2ac9d45a",
}

actual, err := lb.UpgradeStateV1Func(context.Background(), v0Schema, nil)
actual, err := lb.UpgradeStateV1Func(t.Context(), v0Schema, nil)
if err != nil {
t.Fatalf("error migrating state: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/services/mnq/sns_topic_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestAccSNSTopicSubscription_Basic(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ProviderFactories: tt.ProviderFactories,
Expand Down
2 changes: 1 addition & 1 deletion internal/services/mnq/sns_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestAccSNSTopic_Basic(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down
4 changes: 2 additions & 2 deletions internal/services/mnq/sqs_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestAccSQSQueue_Basic(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestAccSQSQueue_DefaultProject(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()

accountAPI := accountSDK.NewProjectAPI(tt.Meta.ScwClient())
projectID := ""
Expand Down
4 changes: 2 additions & 2 deletions internal/services/object/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func TestAccObjectBucket_Cors_Delete(t *testing.T) {
tt := acctest.NewTestTools(t)
defer tt.Cleanup()

ctx := context.Background()
ctx := t.Context()

resourceName := "scaleway_object_bucket.bucket"
bucketName := sdkacctest.RandomWithPrefix("tf-tests-scaleway-object-bucket-cors-delete")
Expand Down Expand Up @@ -714,7 +714,7 @@ func TestAccObjectBucket_DestroyForce(t *testing.T) {

addObjectToBucket := func(tt *acctest.TestTools, n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
ctx := context.Background()
ctx := t.Context()

rs, ok := s.RootModule().Resources[n]
if !ok {
Expand Down
5 changes: 2 additions & 3 deletions internal/services/object/data_source_object_bucket_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package object_test

import (
"context"
"fmt"
"regexp"
"testing"
Expand Down Expand Up @@ -97,7 +96,7 @@ func TestAccDataSourceObjectBucket_ProjectIDAllowed(t *testing.T) {
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeSideProject(tt)
require.NoError(t, err)

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down Expand Up @@ -147,7 +146,7 @@ func TestAccDataSourceObjectBucket_ProjectIDForbidden(t *testing.T) {
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeSideProject(tt)
require.NoError(t, err)

ctx := context.Background()
ctx := t.Context()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
Expand Down
3 changes: 1 addition & 2 deletions internal/services/rdb/helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package rdb_test

import (
"context"
"reflect"
"testing"

Expand All @@ -22,7 +21,7 @@ func TestPrivilegeV1SchemaUpgradeFunc(t *testing.T) {
"user_name": "username",
}

actual, err := rdb.PrivilegeV1SchemaUpgradeFunc(context.Background(), v0Schema, nil)
actual, err := rdb.PrivilegeV1SchemaUpgradeFunc(t.Context(), v0Schema, nil)
if err != nil {
t.Fatalf("error migrating state: %s", err)
}
Expand Down
Loading