Skip to content

addNodesToKubernetesCluster silently skips invalid VMs and reports success #14832

Backlog

Description

@bhouse-nexthop

problem

addNodesToKubernetesCluster checks each VM id in validateNodes, but a VM that fails a check is only logged and dropped from the list. The add worker then runs on the rest, and the job reports success. The caller is never told that some of the VMs it asked for were not added, and the UI shows nothing either.

VM passed result
removed (expunged) VM dropped silently
template not found or deleted dropped silently
template not marked for CKS dropped silently
default NIC not on the cluster network dropped silently
VM with no default NIC NullPointerException
VM already in this cluster dropped silently
valid VM added

The request fails only when every VM is dropped, and then with a generic "No valid nodes found to be added" error that names no VM and gives no reason.

versions

4.21.0 and later (4.22 branch, main)

The steps to reproduce the bug

  1. Create a CKS cluster.
  2. Deploy VM A from a CKS template on the cluster network, and VM B from a template not marked for CKS.
  3. Call addNodesToKubernetesCluster id=<cluster> nodeids=<A>,<B>.
  4. The job succeeds. A is added; B is not, and nothing in the response says so.

What to do about it?

Reject the whole request up front with an InvalidParameterValueException that names each invalid VM and why, before any node is touched.

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