Skip to content

Commit

Permalink
added larger page (#154)
Browse files Browse the repository at this point in the history
* added larger page

* added exists if

* adjusted page size
  • Loading branch information
happytreees committed Feb 8, 2023
1 parent 8413f2d commit 49d53db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vultr/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ func vultrByID(ctx context.Context, client *govultr.Client, id string) (*govultr
// vultrByName returns a vultr instance for a given NodeName.
// Note that if multiple nodes with the same name exist and error will be thrown.
func vultrByName(ctx context.Context, client *govultr.Client, nodeName types.NodeName) (*govultr.Instance, error) {
listOptions := &govultr.ListOptions{}
listOptions := &govultr.ListOptions{PerPage: 300}

var instances []govultr.Instance
for {
i, meta, err := client.Instance.List(ctx, listOptions)
Expand Down
3 changes: 3 additions & 0 deletions vultr/instancesv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func (i *instancesv2) InstanceExists(ctx context.Context, node *v1.Node) (bool,
if strings.Contains(err.Error(), "invalid instance ID") {
return false, nil
}
if strings.Contains(err.Error(), "instance not found") {
return false, nil
}
return false, err
}

Expand Down

0 comments on commit 49d53db

Please sign in to comment.