Skip to content

Fix nightly sweep #3052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged

Fix nightly sweep #3052

merged 1 commit into from
Apr 29, 2025

Conversation

Gnoale
Copy link
Contributor

@Gnoale Gnoale commented Apr 28, 2025

fixes https://github.com/scaleway/terraform-provider-scaleway/actions/runs/14698141826/job/41244881374

When the -sweep flag is passed, the sweep function are ran by the Terraform SDK, and the edgeservices one are using a wrong method to instantiate the client which cause a panic

panic: interface conversion: interface {} is *scw.Client, not *meta.Meta

goroutine 1 [running]:
github.com/scaleway/terraform-provider-scaleway/v2/internal/meta.ExtractScwClient(...)
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/meta/extractors.go:97
github.com/scaleway/terraform-provider-scaleway/v2/internal/services/edgeservices.NewEdgeServicesAPI(...)
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/services/edgeservices/helpers.go:12
github.com/scaleway/terraform-provider-scaleway/v2/internal/services/edgeservices/testfuncs.testSweepRoute.func1(0x1c7b728?)
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/services/edgeservices/testfuncs/sweep.go:204 +0x2a
github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest.Sweep(0x1a5cc48)
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/acctest/sweepers.go:21 +0x8f
github.com/scaleway/terraform-provider-scaleway/v2/internal/services/edgeservices/testfuncs.testSweepRoute({0xc0000bc300?, 0x0?})
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/services/edgeservices/testfuncs/sweep.go:203 +0x1a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.runSweeperWithRegion({0x7ffe1b836aa2, 0xb}, 0xc0003655f0, 0xc000365200, 0xc000365680, 0x0)
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/testing.go:267 +0x631
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.runSweepers({0xc000337180, 0x1, 0xc000365200?}, 0xc000365200, 0x0)
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/testing.go:145 +0x5f2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.TestMain({0x1c64ba0, 0xc000396640})
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/resource/testing.go:123 +0xe6
github.com/scaleway/terraform-provider-scaleway/v2/internal/services/edgeservices_test.TestMain(...)
	/home/runner/work/terraform-provider-scaleway/terraform-provider-scaleway/internal/services/edgeservices/sweep_test.go:15
main.main()
	_testmain.go:63 +0xb3
FAIL	github.com/scaleway/terraform-provider-scaleway/v2/internal/services/edgeservices	0.012s

@Gnoale Gnoale force-pushed the fix-nightly-sweep branch from c0ba311 to c43615f Compare April 28, 2025 16:21
* fixes "panic: interface conversion: interface {} is *scw.Client, not *meta.Meta"
@yfodil yfodil added this pull request to the merge queue Apr 29, 2025
Merged via the queue into master with commit ac2139c Apr 29, 2025
44 checks passed
@yfodil yfodil deleted the fix-nightly-sweep branch April 29, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants