Skip to content

cli: fix node list to show only cluster nodes - #127

Open
HarshwardhanPatil07 wants to merge 2 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:fix-node-list
Open

cli: fix node list to show only cluster nodes#127
HarshwardhanPatil07 wants to merge 2 commits into
bootc-dev:mainfrom
HarshwardhanPatil07:fix-node-list

Conversation

@HarshwardhanPatil07

@HarshwardhanPatil07 HarshwardhanPatil07 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

fixes bink node list which was showing all containers (DNS, HAProxy, registries) across all clusters instead of only the actual nodes for the requested cluster.

Before (bug):
Found 6 cluster node(s):

✗ e2e-dns (status: exited, created: 2026-07-11 13:15:12)
✗ e2e-controller (status: exited, created: 2026-07-11 13:15:12)
✗ e2e-haproxy (status: exited, created: 2026-07-11 13:16:11)
✗ test-node1 (status: exited, created: 2026-08-13 12:20:13)
✗ test-haproxy (status: exited, created: 2026-08-13 12:21:26)
✓ test-dns (status: running, created: 2026-08-24 09:39:27)

After (fixed):
Found 1 cluster node(s):

✓ node1 (role: control-plane, status: running, created: 2026-08-24 10:49:22)

Fixes: #108

@HarshwardhanPatil07

HarshwardhanPatil07 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Johan-Liebert1 @alicefr @ptalgulk01 PTAL

node list was using a container name prefix filter (name=k8s-) which
matched all bink containers including infrastructure ones (DNS, HAProxy).
It also did not scope to the requested cluster and displayed node names
with the cluster prefix baked in.

Switch to label-based filtering (bink.cluster-name) scoped to the
active cluster, skip containers that carry a bink.component label,
and read node names from the bink.node-name label. Also display the
node role when available.

Fixes: bootc-dev#108

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Comment thread test/integration/multinode_test.go Outdated
listOutput := string(listSession.Out.Contents())
Expect(listOutput).To(ContainSubstring(node1), "node list should contain node1")
Expect(listOutput).To(ContainSubstring(node2), "node list should contain node2")
Expect(listOutput).ToNot(ContainSubstring("dns"), "node list should not show DNS container")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it will be better to check the full list content instead of checking the non existence of the dns

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Thanks!

@HarshwardhanPatil07

Copy link
Copy Markdown
Collaborator Author

cc @alicefr

Comment thread test/integration/cluster_test.go Outdated
Comment on lines +165 to +169
nodeListOutput := string(nodeListSession.Out.Contents())
Expect(nodeListOutput).To(ContainSubstring("Found 1 cluster node(s)"))
Expect(nodeListOutput).To(ContainSubstring(customNodeName))
Expect(nodeListOutput).To(ContainSubstring("control-plane"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: What you could do instead is to trim the data and hour of creation and the parethesis, then check the exact string like: Found 1 cluster node(s):\n\n ✓ node1 role: control-plane, status: running, created:. So we know we aren't missing any further line

@alicefr

alicefr commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

One last nit on this, but the change looks good thanks! Also you need to update the last commit message

Add node list verification to the single-node cluster test checking
the exact output content (minus timestamps). Add node count assertions
to the multinode tests to verify the full list.

Assisted-by: AI
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@HarshwardhanPatil07

Copy link
Copy Markdown
Collaborator Author

@alicefr Yes, Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] bink node list shows the pod instead of the node

2 participants