Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: container k8s list shows an empty cluster name for the default control-plane node

Open Beginner friendly
#2,314 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift

Research direction

Start with Sources/ContainerK8s/K8sHelper.swift, especially buildK8sRows, and review the role-label input produced by LinuxNodeProvisioner.swift and K8sCreate.swift. Run or recreate the focused regression test described in the issue, then verify that k8s list reports k8s-dev for the control-plane row and groups matching workers correctly.

Written by the indexing model from the issue text.

Description

Steps to reproduce
  1. On apple/container main at d265d669ecae041bf338cb3b39c4118316d138f0, create a cluster with the default container k8s create path.
  2. Run container k8s list and inspect the CLUSTER column for the k8s-dev control-plane node.

I reproduced the underlying list-row behavior in a focused regression test against this clean main revision, using a ContainerSnapshot with ID k8s-dev and role label control-plane,worker (the label written by the default create path). K8sHelper.buildK8sRows(from:) produced a row whose clusterName was ""; the expected value was "k8s-dev". This focused test did not require a running container service. I have not separately run the end-to-end CLI steps above.

Problem description

The default k8s create path gives the control-plane node both control-plane and worker roles. LinuxNodeProvisioner joins them into the single role label control-plane,worker.

buildK8sRows recognizes a control-plane node only when the whole label equals control-plane. It therefore treats the default node as a worker. Because k8s-dev does not contain -worker-, the orphan-worker name derivation returns an empty cluster name. k8s list renders these rows directly.

Expected: the default node is listed under cluster k8s-dev, and matching worker nodes are grouped under it.

Actual in the focused regression test: the control-plane row has an empty cluster name. The CLI display and grouping impact follows from the same row-building path.

Environment
  • OS: macOS 26.6.2, Apple Silicon
  • Xcode: 27.0
  • Swift: 6.4 development snapshot
  • Container source: apple/container main at d265d669ecae041bf338cb3b39c4118316d138f0
Dominant language
Swift
Stars
50.1k
Forks
1.8k
Avg merge
2d 15h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apple/container

All issues in apple/container

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.