Skip to content

Commit

Permalink
Allow using meta attributes to map server ID
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemarey committed Oct 14, 2021
1 parent 84b03e4 commit cde2a3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,13 @@ func osNovaNodeIDMapBuilder(property string) scaleutils.ClusterNodeIDLookupFunc
property = "unique.platform.aws.hostname"
}
return func(n *api.Node) (string, error) {
val, ok := n.Attributes[property]
mapToUse := n.Attributes
if strings.HasPrefix(property, "meta.") {
mapToUse = n.Meta
property = strings.TrimPrefix(property, "meta.")
}

val, ok := mapToUse[property]
if !ok || val == "" {
return "", fmt.Errorf("attribute %q not found", property)
}
Expand Down

0 comments on commit cde2a3c

Please sign in to comment.