Skip to content

feat: add default linux nodeSelector to listener pod#4377

Open
gateixeira wants to merge 1 commit intoactions:masterfrom
gateixeira:feat/windows-listener-nodeselector
Open

feat: add default linux nodeSelector to listener pod#4377
gateixeira wants to merge 1 commit intoactions:masterfrom
gateixeira:feat/windows-listener-nodeselector

Conversation

@gateixeira
Copy link

The listener is a Linux-only binary. In mixed-OS clusters (e.g. with Windows node pools), the listener pod can be scheduled on a Windows node where it fails with a platform mismatch.

Issue #2652 was closed by #2758 which gave users a workaround via listenerTemplate, but the default behavior still allows the listener to be scheduled on Windows nodes. This PR adds a safe default (kubernetes.io/os: linux) as a defensive approach so users don't need to explicitly configure listenerTemplate just to prevent the listener from landing on a non-Linux node.

Changes:

  • Add default nodeSelector kubernetes.io/os: linux to listener pod spec
  • Define LabelKeyKubernetesOS constant alongside existing k8s labels
  • Make mergeListenerPodWithTemplate preserve the default when the listenerTemplate does not explicitly set a nodeSelector (nil check)
  • Add unit tests for all nodeSelector merge scenarios

Refs: #2652

The listener is a Linux-only binary. In mixed-OS clusters (e.g. with
Windows node pools), the listener pod can be scheduled on a Windows
node where it fails with a platform mismatch.

Issue actions#2652 was closed by actions#2758 which gave users a workaround via
listenerTemplate, but the default behavior still allows the listener
to be scheduled on Windows nodes. This PR adds a safe default
(kubernetes.io/os: linux) so users don't need to explicitly configure
listenerTemplate just to prevent the listener from landing on a
non-Linux node.

Changes:
- Add default nodeSelector kubernetes.io/os: linux to listener pod spec
- Define LabelKeyKubernetesOS constant alongside existing k8s labels
- Make mergeListenerPodWithTemplate preserve the default when the
  listenerTemplate does not explicitly set a nodeSelector (nil check)
- Add unit tests for all nodeSelector merge scenarios

Refs: actions#2652
Copilot AI review requested due to automatic review settings February 11, 2026 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a defensive default to ensure the scale set listener pod (a Linux-only binary) is scheduled onto Linux nodes in mixed-OS Kubernetes clusters, without requiring users to set a custom listenerTemplate.

Changes:

  • Default the listener pod spec.nodeSelector to kubernetes.io/os: linux.
  • Add a LabelKeyKubernetesOS constant for the well-known Kubernetes OS label.
  • Update listener template merging logic to preserve the default nodeSelector unless the template explicitly sets one, with unit tests covering the merge scenarios.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
controllers/actions.github.com/resourcebuilder.go Sets a default Linux NodeSelector on the listener pod and updates template merge behavior to avoid clearing the default when the template nodeSelector is nil.
controllers/actions.github.com/constants.go Introduces LabelKeyKubernetesOS constant (kubernetes.io/os).
controllers/actions.github.com/resourcebuilder_test.go Adds unit tests validating default nodeSelector behavior and template merge override/preserve scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant