Commit a8be25ef authored by Christos Tranoris's avatar Christos Tranoris
Browse files

md file

parent 67a7ee45
Loading
Loading
Loading
Loading
+131 −0
Original line number Diff line number Diff line
@startuml Bootstrap Sequence
!theme plain
skinparam backgroundColor #FEFEFE
skinparam sequenceArrowThickness 2
skinparam roundcorner 10
skinparam maxmessagesize 200

title Giter Controller - Bootstrap Sequence

participant "Spring Boot" as Spring
participant "ProducerBootstrapService" as Bootstrap
participant "SchemaLoaderConfig" as Schema
participant "ProducerProperties" as Props
participant "GitAdapter" as Git
participant "ResourceMapper" as Mapper
participant "CatalogClient" as Catalog
participant "ControllerRouteBuilder" as Routes

== Application Startup ==

Spring -> Bootstrap: ApplicationStartedEvent
activate Bootstrap

Bootstrap -> Bootstrap: onApplicationStarted()
note right: Bootstrap process begins

== Step 1: Load and Validate CRD Schema ==

Bootstrap -> Schema: crdSchema(schemaFile)
activate Schema
Schema --> Bootstrap: JsonNode (CRD Schema)
deactivate Schema

Bootstrap -> Bootstrap: unmarshal to CustomResourceDefinition
Bootstrap -> Bootstrap: Validate group, version, kind
note right
  Extract:
  - group (e.g., stable.example.com)
  - version (e.g., v1)
  - kind (e.g., CronTab)
end note

Bootstrap -> Props: setExchangedCRD(crd)
note right: Store CRD for later use

== Step 2: Log Configuration ==

Bootstrap -> Props: getGit()
Props --> Bootstrap: GitProperties
Bootstrap -> Bootstrap: Log repository URL, path, branch
Bootstrap -> Props: getExchangedCRD()
Props --> Bootstrap: CRD details
Bootstrap -> Bootstrap: Log CRD group, kind

== Step 3: Initialize Git Repository ==

Bootstrap -> Git: initialize()
activate Git
note right
  - Clone if not exists
  - Open if already cloned
  - Configure credentials
end note
Git --> Bootstrap: Success
deactivate Git

== Step 4: Register CRD as ResourceSpecification ==

Bootstrap -> Mapper: KubernetesCRD2OpensliceCRD(crd)
activate Mapper
Mapper --> Bootstrap: List<KubernetesCRDV1>
deactivate Mapper

loop for each KubernetesCRDV1
  Bootstrap -> Mapper: toRSpecCreate(kubeCrd)
  activate Mapper
  Mapper --> Bootstrap: ResourceSpecificationCreate
  deactivate Mapper

  Bootstrap -> Catalog: createOrUpdateResourceSpecByNameCategoryVersion(spec)
  activate Catalog
  note right
    Send via JMS queue:
    CATALOG_UPDADD_RESOURCESPEC
  end note
  Catalog --> Bootstrap: LogicalResourceSpecification
  deactivate Catalog

  Bootstrap -> Props: setRegisteredLogicalResourceSpecification(lrs)
  note right: Store registered spec for route configuration
end

== Step 5: Initialize Camel Routes ==

Bootstrap -> Routes: initializeRoutes()
activate Routes

Routes -> Props: getRegisteredLogicalResourceSpecification()
Props --> Routes: LogicalResourceSpecification

Routes -> Routes: Build queue names from LRS
note right
  Queue pattern:
  - CREATE/{category}/{version}
  - UPDATE/{category}/{version}
  - DELETE/{category}/{version}
end note

Routes -> Routes: Configure Camel routes
note right
  Routes:
  - CREATE -> ResourceRepoService.createResource()
  - UPDATE -> ResourceRepoService.updateResource()
  - DELETE -> ResourceRepoService.deleteResource()
end note

Routes --> Bootstrap: Success
deactivate Routes

Bootstrap --> Spring: Bootstrap Complete
deactivate Bootstrap

note over Spring, Routes
  Service is now ready to:
  - Receive TMF639 Resource operations via JMS
  - Translate to Kubernetes Custom Resources
  - Commit/Push to Git repository
  - Monitor status changes via reconciliation
end note

@enduml