Skip to content

Commit 1750e1c

Browse files
committed
chore(k8s): migrate to context based workflow
1 parent a43d0fc commit 1750e1c

File tree

3 files changed

+109
-103
lines changed

3 files changed

+109
-103
lines changed

scaleway/helpers_k8s.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package scaleway
22

33
import (
4+
"context"
45
"fmt"
56
"strings"
67
"time"
@@ -163,14 +164,14 @@ func convertNodes(res *k8s.ListNodesResponse) []map[string]interface{} {
163164
return result
164165
}
165166

166-
func getNodes(k8sAPI *k8s.API, pool *k8s.Pool) ([]map[string]interface{}, error) {
167+
func getNodes(ctx context.Context, k8sAPI *k8s.API, pool *k8s.Pool) ([]map[string]interface{}, error) {
167168
req := &k8s.ListNodesRequest{
168169
Region: pool.Region,
169170
ClusterID: pool.ClusterID,
170171
PoolID: &pool.ID,
171172
}
172173

173-
nodes, err := k8sAPI.ListNodes(req, scw.WithAllPages())
174+
nodes, err := k8sAPI.ListNodes(req, scw.WithAllPages(), scw.WithContext(ctx))
174175

175176
if err != nil {
176177
return nil, err

0 commit comments

Comments
 (0)