Skip to content

Conversation

@mikolajkucinski
Copy link
Contributor

@mikolajkucinski mikolajkucinski commented Feb 5, 2026

Summary

  • shootFilter is now part of shootSelector struct with labelSelector and expression fields
  • CEL filtering now happens at the watch level via predicates instead of in the reconcile loop
  • CareInstruction controller deletes secrets for shoots that no longer match the CEL expression
  • Label selector now uses LabelSelectorAsSelector to support both matchLabels and matchExpressions
  • Added excludedShoots, excludedShootCount, and effectiveShootCount to CareInstructionStatus
  • CEL filter errors now emit warning events on the CareInstruction

Breaking change: shootSelector field structure changed

Migrate existing CareInstructions with

kubectl get careinstructions -A -o json | \
  jq -c '.items[] |
    .spec.shootSelector = ({
      labelSelector: .spec.shootSelector,
      expression: .spec.shootFilter
    } | del(.[] | nulls)) |
    del(.spec.shootFilter)' | \
  while read -r ci; do
    echo "$ci" | kubectl apply -f -
  done

@mikolajkucinski mikolajkucinski requested a review from a team as a code owner February 5, 2026 12:49
@mikolajkucinski mikolajkucinski marked this pull request as draft February 5, 2026 12:49
@mikolajkucinski mikolajkucinski force-pushed the refactor/consolidate-shoot-selector branch 11 times, most recently from 64696ea to ef8f1b2 Compare February 10, 2026 14:31
- Restructure ShootSelector with nested LabelSelector and Expression fields
- Move CEL filtering to watch-level predicates in shoot controller
- Add ExcludedShoots/EffectiveShootCount status for observability
- Fix ListShoots to support MatchExpressions via LabelSelectorAsSelector

On-behalf-of: @SAP [email protected]
@mikolajkucinski mikolajkucinski force-pushed the refactor/consolidate-shoot-selector branch from ef8f1b2 to c500fb0 Compare February 10, 2026 14:36
@mikolajkucinski mikolajkucinski marked this pull request as ready for review February 10, 2026 14:36
@github-actions
Copy link

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cloudoperators/shoot-grafter/api/v1alpha1 0.00% (ø)
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/api/v1alpha1/careinstruction_types.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/api/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/cloudoperators/shoot-grafter/controller/careinstruction/careinstruction_controller.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/careinstruction/careinstruction_controller_test.go
  • github.com/cloudoperators/shoot-grafter/controller/shoot/shoot_controller_test.go

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