Make porch-server manager-runnable - #1111
Conversation
Assisted-by: Cursor:composer-2.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
✅ Deploy Preview for kpt-porch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Refactors porch-server startup so the apiserver runs as a manager.Runnable under a controller-runtime manager, enabling future HA via leader election while keeping existing server behavior largely intact.
Changes:
- Wrap porch apiserver startup in a
manager.Runnable(PorchServer) and start it via a controller-runtime manager. - Add HA/leader-election CLI flags and a probe-port option for manager health/ready endpoints.
- Update unit/e2e tests to cover new flag parsing and (some) manager health delegation behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/api/advanced_test.go | Makes readiness gate assertions order-insensitive (ElementsMatch). |
| pkg/cmd/server/start.go | Switches startup to manager-based lifecycle; adds probe/HA flags and health delegation helpers. |
| pkg/cmd/server/start_test.go | Adds coverage for new HA/probe flags and standby readiness behavior. |
| pkg/apiserver/porchserver.go | Introduces PorchServer implementing manager.Runnable + LeaderElectionRunnable. |
| pkg/apiserver/config.go | Builds controller-runtime manager, registers controllers, and returns (mgr, porchServer) instead of a standalone server. |
| pkg/apiserver/apiserver_test.go | Adds tests for kubeconfig loading, client construction, New, and HA helpers. |
| go.mod | Moves sigs.k8s.io/cli-utils to indirect dependency. |
Signed-off-by: mozesl-nokia <laszlo.mozes@nokia.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: mozesl-nokia <laszlo.mozes@nokia.com>
Assisted-by: Cursor:composer-2.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
|
The rest of the coverage would probably require envtest, which I'm not familiar with (and would not trust AI with). This was not covered previously either. The security rating is for internal network comms, so false positive. |
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
I know most of the uncovered is config but could we refactor some of it out to helpers and test in isolation? |
Assisted-by: Cursor:grok-4.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Assisted-by: Cursor:grok-4.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Assisted-by: Cursor:grok-4.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Assisted-by: Cursor:grok-4.5 Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
|



Make porch-server manager-runnable
Description
Related Issue(s)
Type of Change
Checklist
Additional Notes (Optional)
AI Disclosure
If so, please describe how: