diff --git a/v3/internal/utilization/azure.go b/v3/internal/utilization/azure.go index b2e1846be..5a747e2c1 100644 --- a/v3/internal/utilization/azure.go +++ b/v3/internal/utilization/azure.go @@ -28,7 +28,9 @@ func gatherAzure(util *Data, client *http.Client) error { if err != nil { // Only return the error here if it is unexpected to prevent // warning customers who aren't running Azure about a timeout. - if _, ok := err.(unexpectedAzureErr); ok { + // If any of the other vendors have already been detected and set, and we have an error, we should not return the error + // If no vendors have been detected, we should return the error. + if _, ok := err.(unexpectedAzureErr); ok && !util.Vendors.AnySet() { return err } return nil diff --git a/v3/internal/utilization/utilization.go b/v3/internal/utilization/utilization.go index ad2a4ea5d..e9b5085d6 100644 --- a/v3/internal/utilization/utilization.go +++ b/v3/internal/utilization/utilization.go @@ -3,7 +3,6 @@ // Package utilization implements the Utilization spec, available at // https://source.datanerd.us/agents/agent-specs/blob/master/Utilization.md -// package utilization import ( @@ -84,6 +83,9 @@ type vendors struct { Kubernetes *kubernetes `json:"kubernetes,omitempty"` } +func (v *vendors) AnySet() bool { + return v.AWS != nil || v.Azure != nil || v.GCP != nil || v.PCF != nil || v.Docker != nil || v.Kubernetes != nil +} func (v *vendors) isEmpty() bool { return nil == v || *v == vendors{} }