Skip to content

feat(delete): the remaining platform CronJobs and RBAC carry the PlatformInstance owner reference (#586 slice c) - #592

Merged
schwarztrinker merged 1 commit into
mainfrom
feat/589-owner-refs
Nov 12, 2026
Merged

schwarztrinker merged 1 commit into
mainfrom
feat/589-owner-refs

Conversation

@schwarztrinker

Copy link
Copy Markdown
Contributor

Refs #589. Slice c of #586.

What changed

Seven functions in crates/stardelt-operator/src/provision.rs take owner: &OwnerReference and apply every object through apply_owned (which stamps the owner reference before the server-side apply):

function objects
ensure_pg_dumps one CronJob per database
ensure_superset_rbac ServiceAccount, Role, RoleBinding
ensure_superset_group_roles ConfigMap, CronJob
ensure_airflow_rbac Role, RoleBinding
ensure_airflow_group_roles ServiceAccount, ConfigMap, RoleBinding, CronJob
ensure_access_sync ServiceAccount, ConfigMap, Role, RoleBinding, CronJob
ensure_identity ConfigMap stardelt-identity (keeps its dry_run: false)

controller.rs passes &owner at the seven call sites in reconcile_platform; 18 test call sites pass &owner(). One new test, the_access_sync_cron_job_carries_the_platform_instance_owner_reference.

Deliberately untouched: ensure_kafka_broker, ensure_trino_config_maps, ensure_trino_tls, ensure_catalog_principals, Secrets, PVCs, CNPG Clusters/ScheduledBackups.

Checks

cargo fmt --check                                 => ok
cargo clippy --all-targets -- -D warnings         => Finished (no warnings)
cargo test the_access_sync_cron_job_carries_the_platform_instance_owner_reference
                                                  => 1 passed; 0 failed; 630 filtered out
cargo test                                        => 631 passed; 0 failed (values_cli: 8 passed)
cargo run --bin crdgen && git diff --exit-code chart/crds schemas => no diff
awk '/pub async fn ensure_(...)/,/^}/' ... | grep -c "apply::<" => 0
grep -c "apply_owned::<" provision.rs             => 28

The ticket's grep -c "apply_owned::<" => 21 is advisory; measured on origin/main at 08d29fa it is 9 before and 28 after (9 + 19 new call sites). The binding check — no apply::< left in the seven functions — is 0.

Mutation check: with own(&mut object, owner) removed from apply_owned, the new test fails (assertion left == right failed at the kind assert); restored.

Remaining

Nothing in this slice.

…formInstance owner reference (D18, operator#589)

Slice c of operator#586: ensure_pg_dumps, ensure_superset_rbac,
ensure_superset_group_roles, ensure_airflow_rbac, ensure_airflow_group_roles,
ensure_access_sync and ensure_identity take the owner reference and apply
through apply_owned, so the garbage collector removes the access-sync CronJob,
the Airflow/Superset RBAC objects, their group-role CronJobs, the pg-dump
CronJobs and ConfigMap stardelt-identity with the instance.
Copilot AI lite review requested due to automatic review settings November 12, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@schwarztrinker
schwarztrinker merged commit 5debf74 into main Nov 12, 2026
2 checks passed
@schwarztrinker
schwarztrinker deleted the feat/589-owner-refs branch November 12, 2026 08:22
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.

2 participants