Skip to content

feat: use copylabels from greenhouse propagator#54

Merged
Zaggy21 merged 7 commits into
mainfrom
feat/shoot-grafter-use-copylabels-from-propagator
May 18, 2026
Merged

feat: use copylabels from greenhouse propagator#54
Zaggy21 merged 7 commits into
mainfrom
feat/shoot-grafter-use-copylabels-from-propagator

Conversation

@Zaggy21
Copy link
Copy Markdown
Contributor

@Zaggy21 Zaggy21 commented May 15, 2026

Summary

  • Upgrade greenhouse dependency from v0.9.0 to v0.11.1, which introduces the lifecycle.CopyLabels method on Propagator
  • Adapt to controller-runtime v0.23 API changes: migrate EventRecorder from k8s.io/client-go/tools/record to the newer k8s.io/client-go/tools/events interface
  • Refactor the Shoot controller's label propagation to use lifecycle.NewPropagator(&shoot, secret).CopyLabels(...) instead of manually writing the propagation annotation onto the Shoot object before calling Apply(), eliminating a side-effecting mutation of the Shoot's annotations
  • Bump transitive k8s dependencies (k8s.io/api, k8s.io/apimachinery, k8s.io/client-go, etc.) to v0.35.x to stay in sync with the upgraded greenhouse module

Copilot AI review requested due to automatic review settings May 15, 2026 07:58
@Zaggy21 Zaggy21 requested a review from a team as a code owner May 15, 2026 07:58
@Zaggy21 Zaggy21 linked an issue May 15, 2026 that may be closed by this pull request
Copy link
Copy Markdown

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

This PR upgrades the Greenhouse dependency (and aligned Kubernetes/controller-runtime dependencies) and refactors label propagation in the Shoot controller to use the new lifecycle.Propagator.CopyLabels(...) API, along with adapting event recording to the newer k8s.io/client-go/tools/events interface.

Changes:

  • Upgrade github.com/cloudoperators/greenhouse to v0.11.1 and bump transitive Kubernetes/controller-runtime dependencies.
  • Migrate event recording from k8s.io/client-go/tools/record to k8s.io/client-go/tools/events.
  • Refactor Shoot→Secret label propagation to use lifecycle.NewPropagator(&shoot, secret).CopyLabels(...) and update tests accordingly.
  • Update webhook registration/defaulter signature to match controller-runtime API changes.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webhook/v1alpha1/careinstruction_webhook.go Updates webhook builder usage and defaulter signature for newer controller-runtime.
controller/shoot/shoot_controller.go Migrates EventRecorder API and refactors label propagation to use CopyLabels.
controller/shoot/shoot_controller_test.go Updates tests for new event recorder accessor and changed propagation behavior/annotations.
controller/careinstruction/careinstruction_controller.go Updates event recorder accessor for controller-runtime changes.
go.mod Bumps greenhouse + Kubernetes/controller-runtime dependencies and adds/adjusts replace directives.
go.sum Updates dependency checksums for the upgraded module set.
.golangci.yaml Updates replace allow-list to reflect newly pinned dependencies.

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

Comment thread go.mod Outdated
Comment thread controller/shoot/shoot_controller.go
@github-actions
Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cloudoperators/shoot-grafter/controller/careinstruction 0.00% (ø)
github.com/cloudoperators/shoot-grafter/controller/shoot 0.00% (ø)
github.com/cloudoperators/shoot-grafter/webhook/v1alpha1 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cloudoperators/shoot-grafter/controller/careinstruction/careinstruction_controller.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/controller/careinstruction/metrics.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/controller/shoot/auth.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/controller/shoot/shoot_controller.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/webhook/v1alpha1/careinstruction_webhook.go 0.00% (ø) 0 0 0

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

  • github.com/cloudoperators/shoot-grafter/controller/shoot/shoot_controller_test.go

Copy link
Copy Markdown

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Comment thread go.mod
Copy link
Copy Markdown
Contributor

@uwe-mayer uwe-mayer left a comment

Choose a reason for hiding this comment

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

LGTM

@Zaggy21 Zaggy21 merged commit 9934243 into main May 18, 2026
11 checks passed
@Zaggy21 Zaggy21 deleted the feat/shoot-grafter-use-copylabels-from-propagator branch May 18, 2026 13:09
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 shoot-grafter] - Use CopyLabels from Propagator

3 participants