Skip to content

Commit

Permalink
give default region to scaleway client for protokube
Browse files Browse the repository at this point in the history
  • Loading branch information
Mia-Cross committed Mar 14, 2023
1 parent 52c54c6 commit f386aeb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions protokube/pkg/protokube/scaleway_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,20 @@ func NewScwCloudProvider() (*ScwCloudProvider, error) {
}
klog.V(4).Infof("Found zone of the running server: %v", zone)

region, err := scaleway.ParseRegionFromZone(zone)
if err != nil {
return nil, fmt.Errorf("unable to parse Scaleway region: %s", err)
}
klog.V(4).Infof("Found region of the running server: %v", region)

privateIP := metadata.PrivateIP
klog.V(4).Infof("Found first private net IP of the running server: %q", privateIP)

scwClient, err := scw.NewClient(
scw.WithUserAgent(scaleway.KopsUserAgentPrefix+kopsv.Version),
scw.WithEnv(),
scw.WithDefaultZone(zone),
scw.WithDefaultRegion(region),
)
if err != nil {
return nil, fmt.Errorf("error creating client: %w", err)
Expand Down

0 comments on commit f386aeb

Please sign in to comment.