Skip to content

Feat/namespace-opt-in#15

Merged
ullbergm merged 7 commits intomainfrom
feat/namespace-opt-in
Aug 9, 2025
Merged

Feat/namespace-opt-in#15
ullbergm merged 7 commits intomainfrom
feat/namespace-opt-in

Conversation

@ullbergm
Copy link
Copy Markdown
Owner

@ullbergm ullbergm commented Aug 8, 2025

This PR introduces namespace opt-in functionality for the object lease controller, allowing the controller to selectively manage objects based on namespace labels. The implementation adds a namespace tracker to monitor which namespaces should be included in lease management.

Key changes:

Adds namespace-based filtering with opt-in label support
Replaces extended-at annotation with lease-start for more precise lease timing control
Refactors the lease controller package structure and improves test coverage

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

Signed-off-by: Magnus Ullberg magnus@ullberg.us

Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
@github-actions github-actions Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/docs Changes made to the documentation. area/source Changes to the source. area/github Changes made in the github directory. labels Aug 8, 2025
@ullbergm ullbergm added enhancement Enhancement of the code, not introducing new features. area/test Changes made to the test. priority/medium This issue may be useful, and needs some attention. labels Aug 8, 2025
@ullbergm ullbergm requested a review from Copilot August 8, 2025 23:28
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 introduces namespace opt-in functionality for the object lease controller, allowing the controller to selectively manage objects based on namespace labels. The implementation adds a namespace tracker to monitor which namespaces should be included in lease management.

Key changes:

  • Adds namespace-based filtering with opt-in label support
  • Replaces extended-at annotation with lease-start for more precise lease timing control
  • Refactors the lease controller package structure and improves test coverage

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/util/tracker.go New namespace tracker utility for managing opt-in namespaces with event notifications
pkg/controllers/namespace_controller.go New controller for monitoring namespace label changes and updating the tracker
pkg/controllers/namespace_controller_test.go Comprehensive test suite for namespace controller functionality
pkg/controllers/lease_controller.go Refactored from leasewatcher package with namespace filtering and lease-start annotation
pkg/controllers/lease_controller_test.go Extensive test coverage for lease controller with namespace tracking
cmd/main.go Added opt-in label configuration and pprof support
go.mod Made go-logr/logr a direct dependency

Comment thread pkg/controllers/lease_controller.go Outdated
Comment thread pkg/util/tracker.go Outdated
Comment thread pkg/controllers/lease_controller.go
Comment thread pkg/controllers/lease_controller_test.go
@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Signed-off-by: Magnus Ullberg <magnus@ullberg.us>
@ullbergm ullbergm merged commit 1443ee8 into main Aug 9, 2025
6 checks passed
@ullbergm ullbergm deleted the feat/namespace-opt-in branch August 9, 2025 00:56
@github-actions
Copy link
Copy Markdown

Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/docs Changes made to the documentation. area/github Changes made in the github directory. area/source Changes to the source. area/test Changes made to the test. enhancement Enhancement of the code, not introducing new features. priority/medium This issue may be useful, and needs some attention. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants