You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/05/12 03:32:59 UTC

[PR] refactor(controller): move web-server Service to parent ownership and… [superset-kubernetes-operator]

villebro opened a new pull request, #46:
URL: https://github.com/apache/superset-kubernetes-operator/pull/46

   ## Summary
   
   Rewrites the maintenance page traffic handoff to eliminate the orphan-delete pattern, which had three high-severity issues: a 503 gap on return (Service selector pointed to nothing between maintenance teardown and web-server readiness), resource leaks on parent deletion (Service had no owner during maintenance), and excessive complexity (orphan-delete + owner-ref juggling + re-adoption).
   
   The parent Superset CR now permanently owns the web-server Service and switches its selector based on lifecycle state. The `SupersetMaintenancePage` child CRD is removed — the maintenance Deployment is managed directly by the parent controller.
   
   Additionally, decomposes `superset_controller.go` (2178 lines) into focused files.
   
   ## Changes
   
   **Service ownership (fixes 503 gap + deletion leak):**
   - Parent owns the web-server Service via `reconcileWebServerService()` — purely declarative, reads `MaintenanceActive` to determine selector (web-server vs maintenance-page labels)
   - `reconcileMaintenanceReturn()` gates selector switchback on web-server Deployment readiness
   - Handles migration from child CR ownership by clearing stale owner references
   
   **Maintenance page simplification:**
   - Removes `SupersetMaintenancePage` CRD (types, manifests, Helm chart, child controller entry)
   - Maintenance Deployment created directly by parent (no child CRD indirection)
   - Removes `takeoverWebServerService()`, `releaseWebServerService()`, `createMaintenanceWebServerService()` — the entire orphan-delete pattern
   
   **Controller decomposition:**
   - `superset_controller.go` → 557 lines (core reconciler, status, shared resources)
   - New `lifecycle.go` (1109 lines) — lifecycle orchestration, task reconciliation, clone
   - New `config_builder.go` (382 lines) — config input building, env vars, operator-injected
   - New `drain.go` (156 lines) — drain logic
   - New `schedule.go` (107 lines) — cron scheduling
   
   ## Breaking changes
   
   - `SupersetMaintenancePage` CRD removed (internal-only, never user-created)
   - `SupersetWebServer` child controller no longer creates a Service (standalone child CRs without a parent will not get a Service)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] refactor(controller): move web-server Service to parent ownership and… [superset-kubernetes-operator]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #46:
URL: https://github.com/apache/superset-kubernetes-operator/pull/46


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] refactor(controller): move web-server Service to parent ownership and… [superset-kubernetes-operator]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #46:
URL: https://github.com/apache/superset-kubernetes-operator/pull/46#issuecomment-4427117958

   ## [Codecov](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `76.94444%` with `249 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 80.23%. Comparing base ([`0be564f`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/0be564f96de27bf7929e0f34703f2818708ebe1e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d4acac5`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/d4acac51485ce10d36832dee7cdcc5a4949a47ce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [internal/controller/lifecycle.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Flifecycle.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9saWZlY3ljbGUuZ28=) | 80.57% | [86 Missing and 35 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/maintenance.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fmaintenance.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9tYWludGVuYW5jZS5nbw==) | 19.60% | [39 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/drain.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fdrain.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9kcmFpbi5nbw==) | 67.14% | [16 Missing and 7 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/schedule.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fschedule.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9zY2hlZHVsZS5nbw==) | 58.82% | [17 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/config\_builder.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fconfig_builder.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9jb25maWdfYnVpbGRlci5nbw==) | 92.60% | [9 Missing and 8 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/networking.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fnetworking.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9uZXR3b3JraW5nLmdv) | 60.97% | [10 Missing and 6 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [internal/controller/superset\_controller.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&filepath=internal%2Fcontroller%2Fsuperset_controller.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9zdXBlcnNldF9jb250cm9sbGVyLmdv) | 23.07% | [7 Missing and 3 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/46?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org