X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0684f84ec50069b24b4564474db67d6b44266699..5c5ac412b722025d1af37f81bea60a4b503ce6aa:/lib/dispatchcloud/driver.go diff --git a/lib/dispatchcloud/driver.go b/lib/dispatchcloud/driver.go index 8d09d6a530..fe498d0484 100644 --- a/lib/dispatchcloud/driver.go +++ b/lib/dispatchcloud/driver.go @@ -8,16 +8,16 @@ import ( "fmt" "time" - "git.curoverse.com/arvados.git/lib/cloud" - "git.curoverse.com/arvados.git/lib/cloud/azure" - "git.curoverse.com/arvados.git/lib/cloud/ec2" - "git.curoverse.com/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/lib/cloud" + "git.arvados.org/arvados.git/lib/cloud/azure" + "git.arvados.org/arvados.git/lib/cloud/ec2" + "git.arvados.org/arvados.git/sdk/go/arvados" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" ) -// Map of available cloud drivers. +// Drivers is a map of available cloud drivers. // Clusters.*.Containers.CloudVMs.Driver configuration values // correspond to keys in this map. var Drivers = map[string]cloud.Driver{ @@ -153,7 +153,11 @@ func (is instrumentedInstanceSet) Create(it arvados.InstanceType, image cloud.Im func (is instrumentedInstanceSet) Instances(tags cloud.InstanceTags) ([]cloud.Instance, error) { instances, err := is.InstanceSet.Instances(tags) is.cv.WithLabelValues("List", boolLabelValue(err != nil)).Inc() - return instances, err + var instrumented []cloud.Instance + for _, i := range instances { + instrumented = append(instrumented, instrumentedInstance{i, is.cv}) + } + return instrumented, err } type instrumentedInstance struct { @@ -176,7 +180,6 @@ func (inst instrumentedInstance) SetTags(tags cloud.InstanceTags) error { func boolLabelValue(v bool) string { if v { return "1" - } else { - return "0" } + return "0" }