Skip to content

CKS: an upgrade records each node's Kubernetes version as raw kubectl output, with a leading v and a trailing newline #14629

Open

Description

@bhouse-nexthop

problem

After a CKS cluster is upgraded, each upgraded node's Kubernetes version (kubernetes_cluster_vm_map.kubernetes_node_version, shown as kubernetesnodeversion in listKubernetesClusters) is stored as the raw output of an SSH command: v1.33.1\n, with a v and a trailing newline. Nodes created by the cluster's create or scale paths store 1.33.1.

upgraded node:  76312E33332E310A  ("v1.33.1\n")
scaled-up node: 312E33332E31      ("1.33.1")

Clients that print the field get a stray line break, and the two forms don't compare equal.

Cause: KubernetesClusterUtil.clusterNodeVersionMatches(...) (the SSH variant, used by KubernetesClusterUpgradeWorker) saves clusterVersionMatchesAndValue.second(), which is the whole output of

sudo /opt/bin/kubectl get nodes | awk '{if ($1 == "<node>") print $5}'

That includes the newline, and anything the command wrote to stderr, such as a sudo warning.

versions

4.21.0.0 and later (since #9102), including 4.22 and main.

The steps to reproduce the bug

  1. Create a CKS cluster at one Kubernetes version.
  2. Upgrade it to a newer version with upgradeKubernetesCluster.
  3. listKubernetesClusters id=<cluster> and look at kubernetesnodeversion for each VM, or SELECT HEX(kubernetes_node_version) FROM kubernetes_cluster_vm_map WHERE cluster_id = <id>.
  4. Upgraded nodes have v<version>\n; nodes added by a later scale-up have <version>.

What to do about it?

Once the node is found at the target version, record that version (the semantic version of the upgrade), the same form the create path records.

Activity

  1. github-actions commented on Nov 10, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    After a CKS upgrade, each upgraded node's Kubernetes version is stored as raw kubectl output, so it includes a leading v and a trailing newline (for example v1.33.1\n). Nodes added by create or scale store 1.33.1. Clients that print the field see a stray line break, and the two forms do not compare equal.

    📊 Assessment

    Dimension Value Reasoning
    Type type:bug Stored data format is inconsistent between upgrade and create/scale
    Component component:cks Upgrade worker and KubernetesClusterUtil
    Severity Severity:Minor Mostly cosmetic in API output, but comparisons break
    Labels type:bug, component:cks, Severity:Minor
    Coding agent Suitable Fix is specified: record the target version, not the command output

    🔗 Similar issues

    💡 Notes and suggestions
    • Reproduction: upgrade a CKS cluster, then check kubernetesnodeversion in listKubernetesClusters, or kubernetes_node_version in kubernetes_cluster_vm_map.
    • The report also notes that stderr from the SSH command (for example a sudo warning) can end up in the same field.

    Generated by Daily Issue Triage · copilot · haiku55 · ~5 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
  2. added this to the 4.22.3 milestone on Nov 11, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions