fix: revert the logic to the previous one

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
This commit is contained in:
Paulo Dias 2025-01-29 14:34:45 +00:00
parent 5a09c71b64
commit 0b8f59f8f9
No known key found for this signature in database
GPG key ID: CE1937300CB848AA

View file

@ -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)