Skip to content

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

Description

@Hokila

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions