Skip to content

Commit

Permalink
Merge pull request #2533 from aleksandra-malinowska/metric-list-insta…
Browse files Browse the repository at this point in the history
…nces

Fix metrics for list and delete instances
  • Loading branch information
k8s-ci-robot authored Nov 13, 2019
2 parents 8871f17 + 24ec1ba commit fe9426a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ func (client *autoscalingGceClientV1) waitForOp(operation *gce.Operation, projec
}

func (client *autoscalingGceClientV1) DeleteInstances(migRef GceRef, instances []GceRef) error {
registerRequest("instance_group_managers", "delete_instances")
req := gce.InstanceGroupManagersDeleteInstancesRequest{
Instances: []string{},
}
for _, i := range instances {
req.Instances = append(req.Instances, GenerateInstanceUrl(i))
}
registerRequest("instance_group_managers", "delete_instances")
op, err := client.gceService.InstanceGroupManagers.DeleteInstances(migRef.Project, migRef.Zone, migRef.Name, &req).Do()
if err != nil {
return err
Expand All @@ -198,6 +198,7 @@ func (client *autoscalingGceClientV1) DeleteInstances(migRef GceRef, instances [
}

func (client *autoscalingGceClientV1) FetchMigInstances(migRef GceRef) ([]cloudprovider.Instance, error) {
registerRequest("instance_group_managers", "list_managed_instances")
gceInstances, err := client.gceService.InstanceGroupManagers.ListManagedInstances(migRef.Project, migRef.Zone, migRef.Name).Do()
if err != nil {
klog.V(4).Infof("Failed MIG info request for %s %s %s: %v", migRef.Project, migRef.Zone, migRef.Name, err)
Expand Down

0 comments on commit fe9426a

Please sign in to comment.