Skip to content

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.

3 participants