Skip to content

Commit 426f45b

Browse files
authored
Merge branch 'master' into instance_server_type_data_source
2 parents 4ba763a + bdc2f21 commit 426f45b

File tree

189 files changed

+40926
-163099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+40926
-163099
lines changed

.github/workflows/acceptance-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Install Terraform
5555
uses: hashicorp/setup-terraform@v3
5656
- name: Install Go
57-
uses: actions/setup-go@v5
57+
uses: actions/setup-go@v6
5858
with:
5959
go-version: stable
6060
# This CI supports skipping flaky or broken tests via GitHub repository variables.
@@ -149,7 +149,7 @@ jobs:
149149
- name: Checkout
150150
uses: actions/checkout@v5
151151
- name: Install Go
152-
uses: actions/setup-go@v5
152+
uses: actions/setup-go@v6
153153
with:
154154
go-version: stable
155155
- name: Install Terraform

.github/workflows/documentation.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ on:
1515
- .github/workflows/documentation.yml
1616
- docs/**
1717

18-
env:
19-
GO_VERSION: "1.24.0"
20-
GO111MODULE: on
21-
2218
jobs:
2319
markdown-link-check:
2420
runs-on: ubuntu-latest
@@ -44,9 +40,9 @@ jobs:
4440
steps:
4541
# Checkout should always be before setup-go to ensure caching is working
4642
- uses: actions/checkout@v5
47-
- uses: actions/setup-go@v5
43+
- uses: actions/setup-go@v6
4844
with:
49-
go-version: ${{ env.GO_VERSION }}
45+
go-version: stable
5046
- uses: actions/cache@v4
5147
continue-on-error: true
5248
timeout-minutes: 2
@@ -60,9 +56,9 @@ jobs:
6056
runs-on: ubuntu-latest
6157
steps:
6258
- uses: actions/checkout@v5
63-
- uses: actions/setup-go@v5
59+
- uses: actions/setup-go@v6
6460
with:
65-
go-version: ${{ env.GO_VERSION }}
61+
go-version: stable
6662
- uses: hashicorp/setup-terraform@v3
6763
- run: go tool tfplugindocs validate
6864
- run: rm -fr ./docs

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v5
1414
- name: Labeler
15-
uses: actions/labeler@v5
15+
uses: actions/labeler@v6

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Install Terraform
5757
uses: hashicorp/setup-terraform@v3
5858
- name: Install Go
59-
uses: actions/setup-go@v5
59+
uses: actions/setup-go@v6
6060
with:
6161
go-version: stable
6262
- name: Run Acceptance Tests
@@ -110,7 +110,7 @@ jobs:
110110
- name: Checkout
111111
uses: actions/checkout@v5
112112
- name: Install Go
113-
uses: actions/setup-go@v5
113+
uses: actions/setup-go@v6
114114
with:
115115
go-version: stable
116116
- name: Install Terraform

.github/workflows/purge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v5
1616
- name: Install Go
17-
uses: actions/setup-go@v5
17+
uses: actions/setup-go@v6
1818
with:
1919
go-version: stable
2020
- name: Install Terraform

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: git fetch --prune --unshallow
2929

3030
- name: Set up Go
31-
uses: actions/setup-go@v5
31+
uses: actions/setup-go@v6
3232
with:
3333
go-version: stable
3434

.github/workflows/terrafmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
# Checkout should always be before setup-go to ensure caching is working
1616
- uses: actions/checkout@v5
17-
- uses: actions/setup-go@v5
17+
- uses: actions/setup-go@v6
1818
with:
1919
go-version: stable
2020
- name: Run terrafmt on documentation

.github/workflows/tfproviderlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
# Checkout should always be before setup-go to ensure caching is working
1616
- uses: actions/checkout@v5
17-
- uses: actions/setup-go@v5
17+
- uses: actions/setup-go@v6
1818
with:
1919
go-version: stable
2020
- name: Install tfproviderlint
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
# Checkout should always be before setup-go to ensure caching is working
3030
- uses: actions/checkout@v5
31-
- uses: actions/setup-go@v5
31+
- uses: actions/setup-go@v6
3232
with:
3333
go-version: stable
3434
- uses: hashicorp/setup-terraform@v3

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
fetch-depth: 1
1919
- name: Install Go
20-
uses: actions/setup-go@v5
20+
uses: actions/setup-go@v6
2121
with:
2222
go-version: stable
2323
- name: Install Terraform

cmd/vcr-compressor/main.go

Lines changed: 4 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,23 @@
11
package main
22

33
import (
4-
"encoding/json"
54
"log"
65
"os"
76

8-
"github.com/scaleway/scaleway-sdk-go/api/k8s/v1"
9-
"github.com/scaleway/scaleway-sdk-go/api/rdb/v1"
10-
"gopkg.in/dnaeon/go-vcr.v3/cassette"
7+
"github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest"
118
)
129

13-
var transientStates = map[string]bool{
14-
k8s.ClusterStatusCreating.String(): true,
15-
k8s.ClusterStatusDeleting.String(): true,
16-
k8s.ClusterStatusUpdating.String(): true,
17-
k8s.PoolStatusDeleting.String(): true,
18-
k8s.PoolStatusScaling.String(): true,
19-
k8s.PoolStatusUpgrading.String(): true,
20-
21-
rdb.DatabaseBackupStatusCreating.String(): true,
22-
rdb.DatabaseBackupStatusDeleting.String(): true,
23-
rdb.DatabaseBackupStatusExporting.String(): true,
24-
rdb.DatabaseBackupStatusRestoring.String(): true,
25-
rdb.InstanceStatusAutohealing.String(): true,
26-
rdb.InstanceStatusBackuping.String(): true,
27-
rdb.InstanceStatusConfiguring.String(): true,
28-
rdb.InstanceStatusDeleting.String(): true,
29-
rdb.InstanceStatusInitializing.String(): true,
30-
rdb.InstanceStatusProvisioning.String(): true,
31-
rdb.InstanceStatusRestarting.String(): true,
32-
rdb.InstanceStatusSnapshotting.String(): true,
33-
}
34-
3510
func main() {
3611
if len(os.Args) < 2 {
3712
log.Fatalf("Usage: %s <cassette_file_name_without_yaml>\n", os.Args[0])
3813
}
3914

4015
path := os.Args[1]
4116

42-
inputCassette, err := cassette.Load(path)
17+
report, err := acctest.CompressCassette(path)
4318
if err != nil {
44-
log.Fatalf("Error while reading file : %v\n", err)
19+
log.Fatalf("%s", err)
4520
}
4621

47-
outputCassette := cassette.New(path)
48-
transitioning := false
49-
50-
for i := range len(inputCassette.Interactions) {
51-
interaction := inputCassette.Interactions[i]
52-
responseBody := interaction.Response.Body
53-
requestMethod := interaction.Request.Method
54-
55-
if requestMethod != "GET" {
56-
transitioning = false
57-
58-
log.Printf("Interaction %d is not a GET request. Recording it\n", i)
59-
outputCassette.AddInteraction(interaction)
60-
61-
continue
62-
}
63-
64-
if responseBody == "" {
65-
log.Printf("Interaction %d got an empty response body. Recording it\n", i)
66-
outputCassette.AddInteraction(interaction)
67-
68-
continue
69-
}
70-
71-
var m map[string]any
72-
73-
err := json.Unmarshal([]byte(responseBody), &m)
74-
if err != nil {
75-
log.Printf("Interaction %d have an error with unmarshalling response body: %v. Recording it\n", i, err)
76-
outputCassette.AddInteraction(interaction)
77-
78-
continue
79-
}
80-
81-
if m["status"] == nil {
82-
log.Printf("Interaction %d does not contain a status field. Recording it\n", i)
83-
outputCassette.AddInteraction(interaction)
84-
85-
continue
86-
}
87-
88-
status := m["status"].(string)
89-
// We test if the state is transient
90-
if _, ok := transientStates[status]; ok {
91-
if transitioning {
92-
log.Printf("Interaction %d is in a transient state while we are already in transitient state. No need to record it: %s\n", i, status)
93-
} else {
94-
log.Printf("Interaction %d is in a transient state: %s, Recording it\n", i, status)
95-
96-
transitioning = true
97-
98-
outputCassette.AddInteraction(interaction)
99-
}
100-
} else {
101-
if transitioning {
102-
log.Printf("Interaction %d is not in a transient state anymore: %s, Recording it\n", i, status)
103-
104-
outputCassette.AddInteraction(interaction)
105-
106-
transitioning = false
107-
} else {
108-
log.Printf("Interaction %d is not in a transient state: %s, Recording it\n", i, status)
109-
outputCassette.AddInteraction(interaction)
110-
}
111-
}
112-
}
113-
114-
err = outputCassette.Save()
115-
if err != nil {
116-
log.Fatalf("error while saving file: %v", err)
117-
}
22+
report.Print()
11823
}

0 commit comments

Comments
 (0)