oracle / oracle/oci-cloud-controller-manager
matching node name by hostname *prefix* can lead to too many instances returned for node name
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 158
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/oci/client/compute.go at the linked line and inspect GetInstanceByNodeName, using the reported hostname examples as the reproduction case. Verify behavior with two node names sharing a VNIC hostname prefix; done means the requested node matches only one instance instead of returning both.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100