diff --git a/internal/namespaces/instance/v1/custom_image_test.go b/internal/namespaces/instance/v1/custom_image_test.go index 13a568ceb5..feab0761b4 100644 --- a/internal/namespaces/instance/v1/custom_image_test.go +++ b/internal/namespaces/instance/v1/custom_image_test.go @@ -88,7 +88,7 @@ func Test_ImageDelete(t *testing.T) { _, err := api.GetSnapshot(&instanceSDK.GetSnapshotRequest{ SnapshotID: snapshot.Snapshot.ID, }) - assert.IsType(t, &scw.ResourceNotFoundError{}, err) + assert.ErrorAs(t, err, new(*scw.ResourceNotFoundError)) }, ), AfterFunc: deleteServer("Server"), diff --git a/internal/namespaces/instance/v1/custom_server_action_test.go b/internal/namespaces/instance/v1/custom_server_action_test.go index 8b6371dad7..9a96f9ca5f 100644 --- a/internal/namespaces/instance/v1/custom_server_action_test.go +++ b/internal/namespaces/instance/v1/custom_server_action_test.go @@ -74,7 +74,7 @@ func Test_ServerTerminate(t *testing.T) { _, err := api.GetIP(&instanceSDK.GetIPRequest{ IP: server.PublicIP.ID, }) - require.IsType(t, &scw.PermissionsDeniedError{}, err) + require.ErrorAs(t, err, new(*scw.PermissionsDeniedError)) }, ), DisableParallel: true, @@ -131,14 +131,14 @@ func Test_ServerTerminate(t *testing.T) { VolumeID: rootVolume.ID, Zone: server.Zone, }) - require.IsType(t, &scw.ResourceNotFoundError{}, err) + require.ErrorAs(t, err, new(*scw.ResourceNotFoundError)) additionalVolume := testhelpers.MapTValue(t, server.Volumes, "1") _, err = api.GetVolume(&blockSDK.GetVolumeRequest{ VolumeID: additionalVolume.ID, Zone: server.Zone, }) - require.IsType(t, &scw.ResourceNotFoundError{}, err) + require.ErrorAs(t, err, new(*scw.ResourceNotFoundError)) }, ), DisableParallel: true, diff --git a/internal/namespaces/vpc/v2/custom_private_network.go b/internal/namespaces/vpc/v2/custom_private_network.go index 24f2eaafd3..29dcc1fd9b 100644 --- a/internal/namespaces/vpc/v2/custom_private_network.go +++ b/internal/namespaces/vpc/v2/custom_private_network.go @@ -71,57 +71,57 @@ func privateNetworkGetBuilder(c *core.Command) *core.Command { g.Go(func() (err error) { instanceServers, err = listCustomInstanceServers(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { baremetalServers, err = listCustomBaremetalServers(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { k8sClusters, err = listCustomK8sClusters(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { lbs, err = listCustomLBs(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { rdbs, err = listCustomRdbs(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { redisClusters, err = listCustomRedisClusters(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { gateways, err = listCustomGateways(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { appleSiliconServers, err = listCustomAppleSiliconServers(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { mongoDBs, err = listCustomMongoDBs(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { ipamIPs, err = listCustomIPAMIPs(groupCtx, client, pn) - return + return err }) g.Go(func() (err error) { inferenceDeployments, err = listCustomInferenceDeployments(groupCtx, client, pn) - return + return err }) if err = g.Wait(); err != nil { diff --git a/internal/tasks/tasks.go b/internal/tasks/tasks.go index 3fad2a3d29..8dfaa9568c 100644 --- a/internal/tasks/tasks.go +++ b/internal/tasks/tasks.go @@ -78,7 +78,7 @@ func Add[TaskArg any, TaskReturn any]( passedData, err = taskFunc(t, i.(TaskArg)) } - return + return passedData, err }, }) }