8d6a527a2b
Completes the workload-first refactor's plugin layer:
- internal/workload/plugin/ — Source/Trigger plugin contract,
registry, types (Workload, DeploymentIntent, InboundEvent,
PublicFace). Self-registering init() pattern + blank-import
in cmd/server/main.go.
- Source plugins: image (blue-green with multi-face proxy routing),
compose, static. Trigger plugins: registry, git, manual.
- internal/deployer/dispatch.go — DispatchPlugin/Teardown/Reconcile
seam routing the legacy deployer through plugins.
- internal/api/workload_*.go — REST surface: workloads, env,
volumes, chain (parent/children), promote-from. hooks.go
serves /api/hooks/kinds/{kind}/schema for the wizard.
- internal/store: workload_env (encrypt-at-rest secrets) and
workload_volumes tables, keyed on workload_id.
- cmd/server/static_backend.go — phantom-row adapter delegating
the static source plugin to the legacy staticsite.Manager
(deleted at hard cutover once the static inline port lands).
- web/src/routes/apps/ — /apps list + /apps/new wizard +
/apps/[id] detail with kind-aware compose / image / static
forms (Advanced JSON toggle), env panel, volumes panel,
webhook panel, chain panel, manual deploy.
Volume scope generalization (v2 resolver):
- internal/volume.ResolveWorkloadPath (workload-keyed, sits
next to legacy ResolvePath). Honors all VolumeScope values:
absolute, ephemeral, instance, stage, project, project_named,
named. internal/workload/plugin/source/image/image.go
computeMounts wires settings + imageTag through. Coverage in
internal/volume/resolver_test.go (portable Linux/Windows via
t.TempDir).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
806 B
Go
28 lines
806 B
Go
package plugin
|
|
|
|
// AllSources returns a snapshot of every registered Source keyed by kind.
|
|
// Snapshot semantics: the caller may iterate freely without holding any
|
|
// lock. Mutating the returned map does not affect the registry.
|
|
func AllSources() map[string]Source {
|
|
sourcesMu.RLock()
|
|
defer sourcesMu.RUnlock()
|
|
out := make(map[string]Source, len(sources))
|
|
for k, v := range sources {
|
|
out[k] = v
|
|
}
|
|
return out
|
|
}
|
|
|
|
// AllTriggers returns a snapshot of every registered Trigger keyed by kind.
|
|
// Used by the single webhook ingress to fan an InboundEvent out across all
|
|
// triggers without per-call locking.
|
|
func AllTriggers() map[string]Trigger {
|
|
triggersMu.RLock()
|
|
defer triggersMu.RUnlock()
|
|
out := make(map[string]Trigger, len(triggers))
|
|
for k, v := range triggers {
|
|
out[k] = v
|
|
}
|
|
return out
|
|
}
|