@startuml
skinparam shadowing false
skinparam backgroundColor #fcfcfd
skinparam defaultFontName Helvetica
skinparam defaultFontSize 14
skinparam arrowColor #0f172a
skinparam noteBackgroundColor #fff7d6
skinparam noteBorderColor #b45309
skinparam noteFontColor #334155
skinparam roundcorner 16
title Sequence - mysql/DbSystem
hide footbox
skinparam sequence {
  actorBorderColor #0f172a
  actorBackgroundColor #e2e8f0
  participantBorderColor #0f172a
  participantBackgroundColor #e2e8f0
  participantFontColor #0f172a
  lifeLineBorderColor #94a3b8
  groupBorderColor #cbd5e1
  groupBackgroundColor #f8fafc
}
actor Kubernetes
participant Controller
participant BaseReconciler
participant "OSOKServiceManager" as ServiceManager
participant OCI
note over BaseReconciler,ServiceManager
shared resolution:
shared/diagrams/shared-resolution-sequence.svg
shared delete:
shared/diagrams/shared-delete-sequence.svg
end note
Kubernetes -> Controller: enqueue DbSystem reconcile
Controller -> BaseReconciler: Reconcile(request)
BaseReconciler -> ServiceManager: reconcile desired DbSystem
group Lookup and bind
alt tracked or explicit OCI identity already exists
ServiceManager -> OCI: GetDbSystem
else tracked identity is missing
ServiceManager -> OCI: ListDbSystems(filters:\ncompartment_id, configuration_id,\ndatabase_management, db_system_id\n(+4 more))
alt reusable OCI resource is not found
ServiceManager -> OCI: CreateDbSystem
loop create pending CREATING, UPDATING
ServiceManager -> OCI: GetDbSystem
end
else reusable OCI resource already exists
ServiceManager -> OCI: GetDbSystem
end
ServiceManager --> BaseReconciler: persist resolved OCI identity in status
end
alt delete requested
group Delete
ServiceManager -> OCI: DeleteDbSystem
ServiceManager -> OCI: confirm delete via GetDbSystem or\nListDbSystems
loop delete pending DELETING
ServiceManager -> OCI: GetDbSystem or ListDbSystems
end
alt cleanup or finalizer release is blocked
ServiceManager --> BaseReconciler: retain delete state and retry
else delete completion observed
ServiceManager --> BaseReconciler: release finalizer after delete completion
end
end
else OCI state is retryable
ServiceManager --> BaseReconciler: requeue while OCI remains in\nCREATING, UPDATING, DELETING
else live state requires field-aware\ndrift evaluation
group Drift handling
note over ServiceManager,OCI
Supported update surface: access_mode,
backup_policy.copy_policies.backup_copy_retention_in_days,
backup_policy.copy_policies.copy_to_region,
backup_policy.defined_tags (+50 more)
Reject before mutate: force-new fields
admin_password, admin_username,
availability_domain, compartment_id (+12
more)
Lookup filters: compartment_id,
configuration_id, database_management,
db_system_id (+4 more)
end note
opt force-new or conflicting drift is detected
ServiceManager --> BaseReconciler: reject before OCI mutation
end
opt supported mutable drift is detected
ServiceManager -> OCI: Apply UpdateDbSystem only for\nmutable fields access_mode,\nbackup_policy.copy_policies.backup_copy_retention_in_days,\nbackup_policy.copy_policies.copy_to_region,\nbackup_policy.defined_tags (+50\nmore)
loop update pending UPDATING
ServiceManager -> OCI: GetDbSystem
end
end
ServiceManager -> OCI: run helper hooks\ncreate=tfresource.CreateResource;\nupdate=tfresource.UpdateResource;\ndelete=tfresource.DeleteResource
end
ServiceManager --> BaseReconciler: status=required,\nfinalizer=retain-until-confirmed-delete
end
BaseReconciler --> Controller: requeue on provisioning, updating,\nterminating
note right of ServiceManager
shared diagram:
shared/diagrams/shared-resolution-sequence.svg
shared delete diagram:
shared/diagrams/shared-delete-sequence.svg
Start from the shared resolution sequence for
OCID binding, datasource pagination, and
create-or-update dispatch.
Layer the shared delete sequence when finalizer
retention, delete confirmation, work-request
polling, or Secret cleanup apply.
archetype batch: Generated service-manager
controllers follow the shared resolution and
delete sequences with imported waits and
controller-local policy.
service: mysql
slug: dbsystem
kind: DbSystem
archetype: generated-service-manager
status/finalizer: required /
retain-until-confirmed-delete
requeue: provisioning, updating, terminating
provider states: create CREATING, UPDATING;
update UPDATING; delete DELETING
supported drift: access_mode,
backup_policy.copy_policies.backup_copy_retention_in_days,
backup_policy.copy_policies.copy_to_region,
backup_policy.defined_tags (+50 more)
reject before mutate: force-new fields
admin_password, admin_username,
availability_domain, compartment_id (+12 more)
list lookup: oci_mysql_mysql_db_systems filters
compartment_id, configuration_id,
database_management, db_system_id (+4 more)
conflicts: none
open gaps: none
Generated runtime reads admin credential secret
refs during OCI request projection and does not
write follow-up Kubernetes secrets.
When no OCI ID is tracked, generated-runtime
pre-create lookup reuses only identifying
ListDbSystems matches that remain in ACTIVE,
CREATING, or UPDATING; deleting, deleted,
failed, or non-identifying matches still call
CreateDbSystem.
end note
@enduml
