From 0b8f59f8f937be13825407e2a635544ddf872e53 Mon Sep 17 00:00:00 2001 From: Paulo Dias Date: Wed, 29 Jan 2025 14:34:45 +0000 Subject: [PATCH] fix: revert the logic to the previous one Signed-off-by: Paulo Dias --- discovery/openstack/instance.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discovery/openstack/instance.go b/discovery/openstack/instance.go index 3492c8d3d8..74eeba8b66 100644 --- a/discovery/openstack/instance.go +++ b/discovery/openstack/instance.go @@ -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)