# centos-automotive-suite/automotive-dev-operator architecture

> Architecture diagram of the GitHub repository centos-automotive-suite/automotive-dev-operator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/centos-automotive-suite/automotive-dev-operator
- Repository: https://github.com/centos-automotive-suite/automotive-dev-operator

## Overview

CentOS Automotive Suite Operator builds automotive OS images on OpenShift, supporting traditional AIB manifests and bootc container builds. The main workflow is a user invoking caib to submit or monitor a build through the Build API; Kubernetes custom resources drive reconciliation, and Tekton executes build tasks whose artifacts can be served or pushed to a registry. The product also includes workspaces, container builds, image catalogs, scheduled builds, resealing, and webhook delivery. Connections are limited to README statements and SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`cmd/main.go`](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/cmd/main.go) (Controller manager), [`internal/controller/imagebuild/controller.go`](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagebuild/controller.go) (Image build controller), [`internal/buildapi/server.go`](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/server.go) (Build API), [`internal/controller/catalogimage/catalogimage_controller.go`](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/catalogimage/catalogimage_controller.go) (Image catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["OpenShift operator"]
  node_build_cr["Build resources"]
  node_operator_main["Controller manager<br/>[main.go]"]
  node_operator_config["Operator config<br/>[controller.go]"]
end

subgraph group_build["Build execution"]
  node_image_controller["Image reconciliation<br/>[controller.go]"]
  node_imagebuild_controller["Image build controller<br/>[controller.go]"]
  node_pipeline_plan["Pipeline planning<br/>[pipeline_plan.go]"]
  node_task_library["Build tasks<br/>[tasks.go]"]
  node_artifact["Image artifacts<br/>[imagestream.go]"]
  node_builder_cache["Builder cache<br/>[controller.go]"]
end

subgraph group_api_cli["API and CLI"]
  node_caib["caib CLI<br/>[main.go]"]
  node_api_client["API client<br/>[client.go]"]
  node_build_api["Build API<br/>[server.go]"]
  node_build_handlers["Catalog handlers<br/>[handlers.go]"]
end

subgraph group_workspace["Workspaces"]
  node_workspace_cr["Workspace resources<br/>[workspace_types.go]"]
  node_workspace_controller["Workspace controller<br/>[controller.go]"]
  node_workspace_agent["Workspace agent<br/>[agent.go]"]
  node_workspace_manifest["Workspace manifests<br/>[manifest.go]"]
end

subgraph group_extensions["Product capabilities"]
  node_container_build["Container builds<br/>[controller.go]"]
  node_catalog["Image catalog"]
  node_scheduled_build["Scheduled builds<br/>[controller.go]"]
  node_reseal["Image resealing<br/>[controller.go]"]
  node_webhook["Webhook delivery<br/>[controller.go]"]
  node_notification["Notifications<br/>[events.go]"]
end

node_user(("Operator user"))
node_tekton["Tekton Pipelines"]

node_user -->|"invokes"| node_caib
node_caib -->|"uses"| node_api_client
node_api_client -->|"calls"| node_build_api
node_build_api -->|"manages"| node_build_cr
node_build_api -->|"routes catalog"| node_build_handlers
node_operator_main -->|"registers"| node_imagebuild_controller
node_operator_main -->|"registers"| node_operator_config
node_operator_main -->|"registers"| node_image_controller
node_operator_main -->|"registers"| node_builder_cache
node_operator_main -->|"registers"| node_container_build
node_operator_main -->|"registers"| node_catalog
node_operator_main -->|"registers"| node_scheduled_build
node_operator_main -->|"registers"| node_reseal
node_operator_main -->|"registers"| node_webhook
node_imagebuild_controller -->|"uses tasks"| node_task_library
node_imagebuild_controller -.->|"plans runs"| node_pipeline_plan
node_pipeline_plan -->|"creates runs"| node_tekton
node_imagebuild_controller -->|"uses image stream"| node_artifact
node_builder_cache -->|"uses tasks"| node_task_library
node_container_build -->|"reads API types"| node_build_cr
node_workspace_controller -->|"uses agent"| node_workspace_agent
node_workspace_controller -->|"reconciles"| node_workspace_cr
node_workspace_manifest -->|"uses labels"| node_workspace_cr
node_scheduled_build -->|"uses publisher"| node_catalog
node_webhook -->|"uses events"| node_notification
node_build_handlers -->|"uses catalog controller"| node_catalog

click node_caib "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/cmd/caib/main.go"
click node_api_client "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/client/client.go"
click node_build_api "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/server.go"
click node_build_handlers "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/catalog/handlers.go"
click node_build_cr "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/api/v1alpha1/imagebuild_types.go"
click node_operator_main "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/cmd/main.go"
click node_operator_config "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/operatorconfig/controller.go"
click node_image_controller "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/image/controller.go"
click node_imagebuild_controller "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagebuild/controller.go"
click node_pipeline_plan "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagebuild/pipeline_plan.go"
click node_task_library "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/tasks/tasks.go"
click node_artifact "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/imagestream/imagestream.go"
click node_builder_cache "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/buildercache/controller.go"
click node_container_build "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/containerbuild/controller.go"
click node_workspace_cr "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/api/v1alpha1/workspace_types.go"
click node_workspace_controller "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/workspace/controller.go"
click node_workspace_agent "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/workspaceagent/agent.go"
click node_workspace_manifest "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/workspacemanifest/manifest.go"
click node_catalog "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/catalogimage/catalogimage_controller.go"
click node_scheduled_build "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/scheduledimagebuild/controller.go"
click node_reseal "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagereseal/controller.go"
click node_webhook "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/webhookdelivery/controller.go"
click node_notification "https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/notifications/events.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build_cr,node_operator_main,node_operator_config,node_user toneBlue
class node_image_controller,node_imagebuild_controller,node_pipeline_plan,node_task_library,node_artifact,node_builder_cache toneAmber
class node_caib,node_api_client,node_build_api,node_build_handlers toneMint
class node_workspace_cr,node_workspace_controller,node_workspace_agent,node_workspace_manifest toneRose
class node_container_build,node_catalog,node_scheduled_build,node_reseal,node_webhook,node_notification,node_tekton toneIndigo
```

## Components

### OpenShift operator

- [Build resources](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/api/v1alpha1/imagebuild_types.go): `api/v1alpha1/imagebuild_types.go`
- [Controller manager](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/cmd/main.go): `cmd/main.go`
- [Operator config](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/operatorconfig/controller.go): `internal/controller/operatorconfig/controller.go`

### Build execution

- [Image reconciliation](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/image/controller.go): `internal/controller/image/controller.go`
- [Image build controller](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagebuild/controller.go): `internal/controller/imagebuild/controller.go`
- [Pipeline planning](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagebuild/pipeline_plan.go): `internal/controller/imagebuild/pipeline_plan.go`
- [Build tasks](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/tasks/tasks.go): `internal/common/tasks/tasks.go`
- [Image artifacts](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/imagestream/imagestream.go): `internal/common/imagestream/imagestream.go`
- [Builder cache](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/buildercache/controller.go): `internal/controller/buildercache/controller.go`

### API and CLI

- [caib CLI](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/cmd/caib/main.go): `cmd/caib/main.go`
- [API client](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/client/client.go): `internal/buildapi/client/client.go`
- [Build API](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/server.go): `internal/buildapi/server.go`
- [Catalog handlers](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/buildapi/catalog/handlers.go): `internal/buildapi/catalog/handlers.go`

### Workspaces

- [Workspace resources](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/api/v1alpha1/workspace_types.go): `api/v1alpha1/workspace_types.go`
- [Workspace controller](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/workspace/controller.go): `internal/controller/workspace/controller.go`
- [Workspace agent](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/workspaceagent/agent.go): `internal/workspaceagent/agent.go`
- [Workspace manifests](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/common/workspacemanifest/manifest.go): `internal/common/workspacemanifest/manifest.go`

### Product capabilities

- [Container builds](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/containerbuild/controller.go): `internal/controller/containerbuild/controller.go`
- [Image catalog](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/catalogimage/catalogimage_controller.go): `internal/controller/catalogimage/catalogimage_controller.go`
- [Scheduled builds](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/scheduledimagebuild/controller.go): `internal/controller/scheduledimagebuild/controller.go`
- [Image resealing](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/imagereseal/controller.go): `internal/controller/imagereseal/controller.go`
- [Webhook delivery](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/controller/webhookdelivery/controller.go): `internal/controller/webhookdelivery/controller.go`
- [Notifications](https://github.com/centos-automotive-suite/automotive-dev-operator/blob/main/internal/notifications/events.go): `internal/notifications/events.go`

### Other components

- **Operator user**
- **Tekton Pipelines**

## Connections

- Operator user → caib CLI: invokes
- caib CLI → API client: uses
- API client → Build API: calls
- Build API → Build resources: manages (evidence: `internal/buildapi/server.go`)
- Build API → Catalog handlers: routes catalog (evidence: `internal/buildapi/server.go`)
- Controller manager → Image build controller: registers (evidence: `cmd/main.go`)
- Controller manager → Operator config: registers (evidence: `cmd/main.go`)
- Controller manager → Image reconciliation: registers (evidence: `cmd/main.go`)
- Controller manager → Builder cache: registers (evidence: `cmd/main.go`)
- Controller manager → Container builds: registers (evidence: `cmd/main.go`)
- Controller manager → Image catalog: registers (evidence: `cmd/main.go`)
- Controller manager → Scheduled builds: registers (evidence: `cmd/main.go`)
- Controller manager → Image resealing: registers (evidence: `cmd/main.go`)
- Controller manager → Webhook delivery: registers (evidence: `cmd/main.go`)
- Image build controller → Build tasks: uses tasks (evidence: `internal/controller/imagebuild/controller.go`)
- Image build controller → Pipeline planning: plans runs
- Pipeline planning → Tekton Pipelines: creates runs (evidence: `internal/controller/imagebuild/pipeline_plan.go`)
- Image build controller → Image artifacts: uses image stream (evidence: `internal/controller/imagebuild/controller.go`)
- Builder cache → Build tasks: uses tasks (evidence: `internal/controller/buildercache/controller.go`)
- Container builds → Build resources: reads API types (evidence: `internal/controller/containerbuild/controller.go`)
- Workspace controller → Workspace agent: uses agent (evidence: `internal/controller/workspace/controller.go`)
- Workspace controller → Workspace resources: reconciles (evidence: `internal/controller/workspace/controller.go`)
- Workspace manifests → Workspace resources: uses labels (evidence: `internal/common/workspacemanifest/manifest.go`)
- Scheduled builds → Image catalog: uses publisher (evidence: `internal/controller/scheduledimagebuild/controller.go`)
- Webhook delivery → Notifications: uses events (evidence: `internal/controller/webhookdelivery/controller.go`)
- Catalog handlers → Image catalog: uses catalog controller (evidence: `internal/buildapi/catalog/handlers.go`)
