Add sync_instances management command for control plane reconciliation #482

Merged
tobru merged 1 commit from instance-sync into main 2026-04-16 13:50:43 +00:00
Owner

Introduces a new management command that reconciles service instances between Kubernetes control planes and the portal database. Supports three checks: orphaned instances on K8s, missing instances on K8s, and annotation/spec drift. Also detects orphaned namespaces and namespace metadata drift.

Default mode is dry-run (report only). With --apply, prompts interactively for each discrepancy. Handles deletion protection removal when deleting instances, mirroring the existing decommission process.

Adds imported_at field to ServiceInstance to mark instances adopted from control planes rather than created through the portal.

Introduces a new management command that reconciles service instances between Kubernetes control planes and the portal database. Supports three checks: orphaned instances on K8s, missing instances on K8s, and annotation/spec drift. Also detects orphaned namespaces and namespace metadata drift. Default mode is dry-run (report only). With --apply, prompts interactively for each discrepancy. Handles deletion protection removal when deleting instances, mirroring the existing decommission process. Adds imported_at field to ServiceInstance to mark instances adopted from control planes rather than created through the portal.
Add sync_instances management command for control plane reconciliation
All checks were successful
Tests / test (push) Successful in 43s
50a8fd9b6a
Introduces a new management command that reconciles service instances
between Kubernetes control planes and the portal database. Supports
three checks: orphaned instances on K8s, missing instances on K8s,
and annotation/spec drift. Also detects orphaned namespaces and
namespace metadata drift.

Default mode is dry-run (report only). With --apply, prompts
interactively for each discrepancy. Handles deletion protection
removal when deleting instances, mirroring the existing decommission
process.

Adds imported_at field to ServiceInstance to mark instances adopted
from control planes rather than created through the portal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tobru merged commit 0c8122f521 into main 2026-04-16 13:50:43 +00:00
tobru deleted branch instance-sync 2026-04-16 13:50:44 +00:00
Sign in to join this conversation.
No description provided.