Skip to content

feat(shoot): set workerless annotation on secret for workerless shoots - #79

Merged
Zaggy21 merged 4 commits into
mainfrom
feat/enforce-payloadschedulable-condition-check
Sep 25, 2026
Merged

Zaggy21 merged 4 commits into
mainfrom
feat/enforce-payloadschedulable-condition-check

Conversation

@Zaggy21

@Zaggy21 Zaggy21 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Detect workerless Gardener shoots (those with an empty spec.provider.workers) during reconciliation
  • Set the greenhouse.sap/workerless: "true" annotation on the Greenhouse cluster secret for workerless shoots
  • Remove the annotation when a formerly workerless shoot gains worker pools

Context
Part of #1967. Workerless shoots (Gardener etcd-only clusters with no worker nodes) can never schedule pods. The greenhouse.sap/workerless annotation on the cluster secret is the signal the Greenhouse bootstrap controller uses to set cluster.spec.mode=Workerless, which in turn gates PayloadSchedulable and blocks Plugin deployments to those clusters.

…orkerless shoots

On-behalf-of: @SAP krzysztof.zagorski@sap.com
Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 21:44
@Zaggy21
Zaggy21 requested a review from a team as a code owner September 7, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is localized, matches the stated behavior in the PR description, and includes targeted tests for both setting and removing the workerless annotation.

Pull request overview

This PR extends the Shoot reconciliation flow to detect “workerless” Gardener Shoots (no spec.provider.workers) and reflect that state on the generated Greenhouse cluster Secret via the greenhouse.sap/workerless: "true" annotation, which is then used downstream by the Greenhouse bootstrap controller to switch cluster mode and gate scheduling/plugin rollout.

Changes:

  • Annotate the Greenhouse cluster Secret with greenhouse.sap/workerless: "true" when a Shoot has zero worker pools.
  • Ensure the annotation is removed on subsequent reconciliations when a previously workerless Shoot gains workers.
  • Add/adjust controller tests to cover workerless creation and the “workerless → workers added” transition.
File summaries
File Description
controller/shoot/shoot_controller.go Detects workerless Shoots and sets/removes the greenhouse.sap/workerless annotation on the Greenhouse cluster Secret during reconciliation.
controller/shoot/shoot_controller_test.go Updates fixtures to include worker pools where needed and adds test coverage for workerless annotation add/remove behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mikolajkucinski mikolajkucinski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

couple of small things :)

Comment thread controller/shoot/shoot_controller.go Outdated
Comment thread controller/shoot/shoot_controller.go Outdated
Comment thread controller/shoot/shoot_controller_test.go Outdated
…nt and test description

On-behalf-of: @SAP krzysztof.zagorski@sap.com
Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
Comment thread controller/shoot/shoot_controller.go Outdated
On-behalf-of: @SAP krzysztof.zagorski@sap.com
Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
…constant

On-behalf-of: @SAP krzysztof.zagorski@sap.com
Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
shoot-grafter/controller/shoot 84.18% (+0.17%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
shoot-grafter/controller/shoot/shoot_controller.go 89.04% (+0.20%) 228 (+4) 203 (+4) 25 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • shoot-grafter/controller/shoot/shoot_controller_test.go

@Zaggy21
Zaggy21 merged commit da996e5 into main Sep 25, 2026
7 checks passed
@Zaggy21
Zaggy21 deleted the feat/enforce-payloadschedulable-condition-check branch September 25, 2026 13:47
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.

[FEAT] - Enforce PayloadSchedulable condition check in Plugin controller

3 participants