@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 Activity - functions/Function
skinparam activity {
  backgroundColor #f8fafc
  borderColor #0f172a
  fontColor #0f172a
  diamondBackgroundColor #e2e8f0
  diamondBorderColor #1d4ed8
  diamondFontColor #0f172a
  startColor #1d4ed8
  endColor #0f172a
  barColor #1d4ed8
}
start
partition "Observe and Bind" {
:Start from shared flow\nshared/diagrams/shared-reconcile-activity.svg;
:Read desired Function spec, tracked status,\nand delete intent;
if ("Tracked or explicit OCI identity present?") then (yes)
:Get the current OCI resource via GetFunction;
else (no)
:Resolve an existing OCI resource through\nListFunction using filters compartment_id,\nstate;
:Create the OCI resource via CreateFunction\nwhen no reusable match is found;
:Persist the resolved or created OCI identity\ninto status;
endif
}
if ("Delete requested?") then (yes)
partition "Delete" {
:Delete path uses DeleteFunction with required\nvia GetFunction or ListFunction to DELETED\nconfirmation;
:Confirm deletion via GetFunction or\nListFunction until OCI reaches DELETED;
if ("Delete cleanup and finalizer release succeed?") then (yes)
:Remove the finalizer after delete completion;
else (no)
:Stay blocked until cleanup or finalizer\nrelease succeeds;
endif
}
stop
else (no)
partition "Lifecycle Classification" {
if ("OCI state in retryable set?") then (yes)
:Request requeue while OCI remains in\nPROVISIONING, UPDATING, DELETING;
stop
endif
if ("OCI state is outside success targets?") then (yes)
:Return an unsuccessful reconcile result until\nOCI reaches ACTIVE;
stop
endif
}
partition "Ready and Drift Handling" {
:Compare live OCI state against the imported\nfield surface;
if ("Force-new or conflicting drift detected?") then (yes)
:Reject drift before OCI mutation for force-new\nfields compartment_id;
stop
endif
if ("Supported mutable drift detected?") then (yes)
:Apply UpdateFunction only for mutable fields\ndisplay_name;
else (no)
:Skip the no-op mutation path;
endif
:Run provider helper hooks\ncreate=tfresource.CreateResource,\ntfresource.WaitForWorkRequestWithErrorHandling\nentity=template action=CREATED;\nupdate=tfresource.UpdateResource;\ndelete=tfresource.DeleteResource when the\nmatching field-driven path executes;
:Return success for the ACTIVE success state;
:Project required status and finalizer policy\nretain-until-confirmed-delete;
:Requeue on provisioning, updating, terminating;
}
endif
stop
note right
shared diagram:
shared/diagrams/shared-reconcile-activity.svg
Start from the shared reconcile activity and
specialize provider-backed CRUD, wait, and
status-projection details here.
Controller-local activity diagrams add
list-lookup hints, secret policies, delete
handling, and open formal gaps.
archetype batch: Generated service-manager
controllers specialize the shared reconcile path
with formal runtime ownership.
service: functions
slug: function
kind: Function
archetype: generated-service-manager
status/finalizer: required /
retain-until-confirmed-delete
requeue: provisioning, updating, terminating
provider states: create PROVISIONING; update
UPDATING; delete DELETING
supported drift: display_name
reject before mutate: force-new fields
compartment_id
list lookup: scaffold_functions_function filters
compartment_id, state
conflicts: none
open gaps: none
Scaffold metadata only; replace with
controller-specific runtime states before
promotion.
end note
@enduml
