bc_gitops_reconciler (bc_gitops v0.7.0)

View Source

Core reconciliation loop for bc_gitops.

This gen_server implements the GitOps reconciliation pattern: 1. Pull latest changes from git 2. Parse desired state from repository 3. Compare with current state 4. Apply necessary changes (deploy, upgrade, remove)

The reconciler runs on a configurable interval and emits telemetry events for observability.

Summary

Types

isolation_mode/0

-type isolation_mode() :: embedded | vm.

Functions

deploy(App_spec)

-spec deploy(#app_spec{name :: atom(),
                       version :: binary(),
                       description :: binary() | undefined,
                       icon ::
                           #icon_spec{type :: url | base64 | identicon,
                                      value :: binary() | undefined,
                                      mime_type :: binary() | undefined} |
                           undefined,
                       source ::
                           #source_spec{type :: release | git | hex | mesh,
                                        url :: binary() | undefined,
                                        sha256 :: binary() | undefined,
                                        ref :: binary() | undefined,
                                        mcid :: binary() | undefined},
                       env :: #{atom() => term()},
                       health ::
                           #health_spec{type :: http | tcp | custom,
                                        port :: pos_integer(),
                                        path :: binary() | undefined,
                                        interval :: pos_integer(),
                                        timeout :: pos_integer(),
                                        module :: module() | undefined} |
                           undefined,
                       depends_on :: [atom()],
                       isolation :: isolation_mode(),
                       vm_config ::
                           #vm_config{memory_limit :: pos_integer() | undefined,
                                      scheduler_limit :: pos_integer() | undefined,
                                      node_prefix :: binary() | undefined,
                                      extra_args :: [binary()]} |
                           undefined}) ->
                ok | {error, term()}.

get_current_state()

-spec get_current_state() -> {ok, map()} | {error, term()}.

get_desired_state()

-spec get_desired_state() -> {ok, map()} | {error, term()}.

handle_call(Request, From, State)

handle_cast(Request, State)

handle_info(Info, State)

init(Config)

reconcile()

-spec reconcile() -> ok | {error, term()}.

remove(AppName)

-spec remove(atom()) -> ok | {error, term()}.

start_link(Config)

-spec start_link(map()) -> {ok, pid()} | {error, term()}.

status()

-spec status() -> {ok, map()} | {error, not_running | busy}.

terminate(Reason, State)

upgrade(AppName, NewVersion)

-spec upgrade(atom(), binary()) -> ok | {error, term()}.