mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix: revert the logic to the previous one
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
This commit is contained in:
parent
5a09c71b64
commit
0b8f59f8f9
|
@ -255,11 +255,11 @@ func (i *InstanceDiscovery) refresh(ctx context.Context) ([]*targetgroup.Group,
|
|||
// Fallback to using flavor.id from the original server list if flavor.original_name wasn't set
|
||||
if _, exists := labels[openstackLabelInstanceFlavor]; !exists {
|
||||
flavorID, idOk := s.Flavor["id"].(string)
|
||||
if idOk {
|
||||
labels[openstackLabelInstanceFlavor] = model.LabelValue(flavorID)
|
||||
} else {
|
||||
if !idOk {
|
||||
i.logger.Warn("Invalid type for both flavor.original_name and flavor.id in server, expected string", "instance", s.ID)
|
||||
continue
|
||||
}
|
||||
labels[openstackLabelInstanceFlavor] = model.LabelValue(flavorID)
|
||||
}
|
||||
|
||||
imageID, ok := s.Image["id"].(string)
|
||||
|
|
Loading…
Reference in a new issue