oci-cloud-controller-manager
oci-cloud-controller-manager copied to clipboard
matching node name by hostname *prefix* can lead to too many instances returned for node name
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
CCM Version: all
What happened?
When nodes come from an OCI instance pools, many of them will have the same hostname prefix causing errors in GetInstanceByNodeName:
Example scenario:
VNIC hostname label: ashburn-ops-node-ad1-vnic
Two example nodes:
node 1: ashburn-ops-node-ad1-vnic-850450
node 2: ashburn-ops-node-ad1-vnic-283027
i.e. strings.HasPrefix(nodeName, *vnic.HostnameLabel) is true for both these nodes leading to:
ERROR cloud/node_controller.go:140 GetInstanceByNodeName: too many instances returned for node name "ashburn-ops-node-ad1-vnic-850450": 2
What you expected to happen?
Only one node to be matched.
How to reproduce it (as minimally and precisely as possible)?
Have multiple nodes with the same prefix.