Skip to content

Commit 9046217

Browse files
committed
chore: update go.mod and go.sum for SDK waiters integration
1 parent 14b43a5 commit 9046217

File tree

7 files changed

+74
-111
lines changed

7 files changed

+74
-111
lines changed

docs/data-sources/cockpit_preconfigured_alert.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ In addition to all arguments above, the following attributes are exported:
9898
- `data_source_id` - ID of the data source containing the alert rule.
9999

100100

101+

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ require (
3030
github.com/nats-io/jwt/v2 v2.8.0
3131
github.com/nats-io/nats.go v1.46.1
3232
github.com/robfig/cron/v3 v3.0.1
33-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251017125838-3eb0f2adaa94
33+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251121164012-c666d15170bb
3434
github.com/stretchr/testify v1.11.1
3535
golang.org/x/crypto v0.43.0
36-
golang.org/x/sync v0.17.0
36+
golang.org/x/sync v0.18.0
3737
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
3838
gopkg.in/dnaeon/go-vcr.v4 v4.0.5
3939
)
@@ -166,7 +166,7 @@ require (
166166
golang.org/x/net v0.46.0 // indirect
167167
golang.org/x/sys v0.37.0 // indirect
168168
golang.org/x/term v0.36.0 // indirect
169-
golang.org/x/text v0.30.0 // indirect
169+
golang.org/x/text v0.31.0 // indirect
170170
golang.org/x/tools v0.38.0 // indirect
171171
google.golang.org/appengine v1.6.8 // indirect
172172
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect

go.sum

Lines changed: 67 additions & 0 deletions
Large diffs are not rendered by default.

internal/services/cockpit/alert_manager_test.go

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -129,35 +129,6 @@ func TestAccCockpitAlertManager_UpdateSingleContact(t *testing.T) {
129129
})
130130
}
131131

132-
func TestAccCockpitAlertManager_EnableDisable(t *testing.T) {
133-
t.Skip("TestAccCockpit_WithSourceEndpoints skipped: encountered repeated HTTP 500 errors from the Scaleway Cockpit API.")
134-
135-
tt := acctest.NewTestTools(t)
136-
defer tt.Cleanup()
137-
138-
resource.ParallelTest(t, resource.TestCase{
139-
ProtoV6ProviderFactories: tt.ProviderFactories,
140-
CheckDestroy: testAccCockpitAlertManagerAndContactsDestroy(tt),
141-
Steps: []resource.TestStep{
142-
{
143-
Config: testAccCockpitAlertManagerEnableConfig(true),
144-
Check: resource.ComposeTestCheckFunc(
145-
resource.TestCheckResourceAttrSet("scaleway_cockpit_alert_manager.alert_manager", "region"),
146-
resource.TestCheckResourceAttrSet("scaleway_cockpit_alert_manager.alert_manager", "alert_manager_url"),
147-
testAccCheckAlertManagerEnabled(tt, "scaleway_cockpit_alert_manager.alert_manager", true),
148-
),
149-
},
150-
{
151-
Config: testAccCockpitAlertManagerEnableConfig(false),
152-
Check: resource.ComposeTestCheckFunc(
153-
resource.TestCheckResourceAttr("scaleway_cockpit_alert_manager.alert_manager", "enable_managed_alerts", "false"),
154-
testAccCheckAlertManagerEnabled(tt, "scaleway_cockpit_alert_manager.alert_manager", false),
155-
),
156-
},
157-
},
158-
})
159-
}
160-
161132
func TestAccCockpitAlertManager_IDHandling(t *testing.T) {
162133
tt := acctest.NewTestTools(t)
163134
defer tt.Cleanup()
@@ -168,13 +139,7 @@ func TestAccCockpitAlertManager_IDHandling(t *testing.T) {
168139
Steps: []resource.TestStep{
169140
{
170141
Config: `
171-
resource "scaleway_account_project" "project" {
172-
name = "tf_test_cockpit_alert_manager_id_parsing"
173-
}
174-
175142
resource "scaleway_cockpit_alert_manager" "main" {
176-
project_id = scaleway_account_project.project.id
177-
178143
contact_points {
179144
email = "test@example.com"
180145
}
@@ -191,13 +156,7 @@ func TestAccCockpitAlertManager_IDHandling(t *testing.T) {
191156
},
192157
{
193158
Config: `
194-
resource "scaleway_account_project" "project" {
195-
name = "tf_test_cockpit_alert_manager_id_parsing"
196-
}
197-
198159
resource "scaleway_cockpit_alert_manager" "main" {
199-
project_id = scaleway_account_project.project.id
200-
201160
contact_points {
202161
email = "updated@example.com"
203162
}
@@ -225,55 +184,12 @@ func testAccCockpitAlertManagerConfigWithContacts(contactPoints []map[string]str
225184
}
226185

227186
return fmt.Sprintf(`
228-
resource "scaleway_account_project" "project" {
229-
name = "tf_test_project"
230-
}
231-
232187
resource "scaleway_cockpit_alert_manager" "alert_manager" {
233-
project_id = scaleway_account_project.project.id
234188
%s
235189
}
236190
`, contactsConfig)
237191
}
238192

239-
func testAccCockpitAlertManagerEnableConfig(enable bool) string {
240-
return fmt.Sprintf(`
241-
resource "scaleway_account_project" "project" {
242-
name = "tf_test_project"
243-
}
244-
245-
resource "scaleway_cockpit_alert_manager" "alert_manager" {
246-
project_id = scaleway_account_project.project.id
247-
enable_managed_alerts = %t
248-
}
249-
`, enable)
250-
}
251-
252-
func testAccCheckAlertManagerEnabled(tt *acctest.TestTools, resourceName string, expectedEnabled bool) resource.TestCheckFunc {
253-
return func(s *terraform.State) error {
254-
rs, ok := s.RootModule().Resources[resourceName]
255-
if !ok {
256-
return errors.New("alert manager not found: " + resourceName)
257-
}
258-
259-
api := cockpit.NewRegionalAPI(meta.ExtractScwClient(tt.Meta))
260-
projectID := rs.Primary.Attributes["project_id"]
261-
262-
alertManager, err := api.GetAlertManager(&cockpit.RegionalAPIGetAlertManagerRequest{
263-
ProjectID: projectID,
264-
})
265-
if err != nil {
266-
return err
267-
}
268-
269-
if alertManager.ManagedAlertsEnabled != expectedEnabled {
270-
return fmt.Errorf("alert manager enabled state %t does not match expected state %t", alertManager.AlertManagerEnabled, expectedEnabled)
271-
}
272-
273-
return nil
274-
}
275-
}
276-
277193
func testAccCheckCockpitContactPointExists(tt *acctest.TestTools, resourceName string) resource.TestCheckFunc {
278194
return func(s *terraform.State) error {
279195
rs, ok := s.RootModule().Resources[resourceName]
@@ -390,13 +306,7 @@ func TestAccCockpitAlertManager_WithPreconfiguredAlerts(t *testing.T) {
390306
Steps: []resource.TestStep{
391307
{
392308
Config: `
393-
resource "scaleway_account_project" "project" {
394-
name = "tf_tests_cockpit_alert_preconfigured"
395-
}
396-
397309
resource "scaleway_cockpit_alert_manager" "main" {
398-
project_id = scaleway_account_project.project.id
399-
400310
# Enable 2 specific preconfigured alerts (stable IDs)
401311
preconfigured_alert_ids = [
402312
"6c6843af-1815-46df-9e52-6feafcf31fd7", # PostgreSQL Too Many Connections
@@ -434,13 +344,7 @@ func TestAccCockpitAlertManager_UpdatePreconfiguredAlerts(t *testing.T) {
434344
Steps: []resource.TestStep{
435345
{
436346
Config: `
437-
resource "scaleway_account_project" "project" {
438-
name = "tf_tests_cockpit_alert_update"
439-
}
440-
441347
resource "scaleway_cockpit_alert_manager" "main" {
442-
project_id = scaleway_account_project.project.id
443-
444348
# Enable a specific PostgreSQL alert (stable ID)
445349
preconfigured_alert_ids = [
446350
"6c6843af-1815-46df-9e52-6feafcf31fd7" # PostgreSQL Too Many Connections
@@ -462,13 +366,7 @@ func TestAccCockpitAlertManager_UpdatePreconfiguredAlerts(t *testing.T) {
462366
},
463367
{
464368
Config: `
465-
resource "scaleway_account_project" "project" {
466-
name = "tf_tests_cockpit_alert_update"
467-
}
468-
469369
resource "scaleway_cockpit_alert_manager" "main" {
470-
project_id = scaleway_account_project.project.id
471-
472370
# Enable 2 specific alerts (stable IDs)
473371
preconfigured_alert_ids = [
474372
"6c6843af-1815-46df-9e52-6feafcf31fd7", # PostgreSQL Too Many Connections
@@ -491,13 +389,7 @@ func TestAccCockpitAlertManager_UpdatePreconfiguredAlerts(t *testing.T) {
491389
},
492390
{
493391
Config: `
494-
resource "scaleway_account_project" "project" {
495-
name = "tf_tests_cockpit_alert_update"
496-
}
497-
498392
resource "scaleway_cockpit_alert_manager" "main" {
499-
project_id = scaleway_account_project.project.id
500-
501393
# Disable all
502394
preconfigured_alert_ids = []
503395

internal/services/cockpit/preconfigured_alert_data_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,4 @@ func dataSourceCockpitPreconfiguredAlertRead(ctx context.Context, d *schema.Reso
173173
return nil
174174
}
175175

176+

templates/data-sources/cockpit_preconfigured_alert.md.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ In addition to all arguments above, the following attributes are exported:
9898
- `data_source_id` - ID of the data source containing the alert rule.
9999

100100

101+

templates/guides/migration_guide_cockpit_alert_manager.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,4 @@ If Terraform shows unexpected changes to `preconfigured_alert_ids`:
164164
- [Cockpit Preconfigured Alert Data Source Documentation](../data-sources/cockpit_preconfigured_alert.md)
165165
- [Scaleway Cockpit Documentation](https://www.scaleway.com/en/docs/observability/cockpit/)
166166

167+

0 commit comments

Comments
 (0)