oci-cloud-controller-manager icon indicating copy to clipboard operation
oci-cloud-controller-manager copied to clipboard

matching node name by hostname *prefix* can lead to too many instances returned for node name

Open jlamillan opened this issue 3 years ago • 0 comments

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.

Anything else we need to know?

jlamillan avatar May 25 '22 18:05 jlamillan