Skip to content

openshift-label-machines

Apply compose-expanded openshift/machine-labels to each cluster member via oc label node

This task runs on the cluster coordinator machine in the post-flexiflow sequence, after openshift-cluster-wait-for-bootstrap-complete and openshift-cluster-transition-to-installation, and before openshift-cluster-wait-for-install-complete. At this point the cluster API is up but the install has not yet finished. It enumerates all cluster member machines (those with the cluster profile applied and openshift/in-process: true), retrieves the compose-expanded openshift/machine-labels map for each member, and applies the labels to the corresponding OpenShift node using oc label node ... --overwrite.

Requirements

  • Cluster API is reachable and oc is authenticated (provided by the openshift-client-runner context and the openshift-refresh-kubeconfig prerequisite)
  • Member machines have their final node names set (DRP machine Name matches the OpenShift node name)

Behaviour

  • Missing openshift/machine-labels: member is skipped silently
  • Node not yet visible: retried 5 times with 10s backoff before logging a warning
  • Failure to apply any label: collected and reported as a task failure

Idempotency

All calls use --overwrite, so the task can be re-run to reconcile labels.

Objects that Reference openshift-label-machines

Objects used by openshift-label-machines