Skip to content

Commit

Permalink
fix init with wrong client
Browse files Browse the repository at this point in the history
  • Loading branch information
vooon committed Nov 1, 2023
1 parent b78c4f4 commit 15eaf02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (g *InstanceGroup) Init(ctx context.Context, log hclog.Logger, settings pro

var cluster *clusters.Cluster
if g.ClusterID != "" {
cluster, err = clusters.Get(cli, g.ClusterID).Extract()
cluster, err = clusters.Get(g.clusteringClient, g.ClusterID).Extract()
if err != nil {
return provider.ProviderInfo{}, fmt.Errorf("Failed to get cluster by id: %w", err)
}
} else {
page, err := clusters.List(cli, clusters.ListOpts{Name: g.Name}).AllPages()
page, err := clusters.List(g.clusteringClient, clusters.ListOpts{Name: g.Name}).AllPages()
if err != nil {
return provider.ProviderInfo{}, fmt.Errorf("Failed to get cluster by name: %w", err)
}
Expand Down

0 comments on commit 15eaf02

Please sign in to comment.