feat(configuration): name the instance with ARCHIE_INSTANCE and scope default paths by it

This commit is contained in:
sam committed 2026-10-19 10:12:48 +11:00
1 parent 5a9d223a63
commit ffdb1ce583
9 files changed
+75 -26

No files matched your search

@@ -17,6 +17,7 @@ import (
"github.com/samcharles93/archie-core/internal/domain/applystatus"
"github.com/samcharles93/archie-core/internal/domain/storepkg"
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
"github.com/samcharles93/archie-core/internal/infrastructure/controlplanerpc"
"github.com/samcharles93/archie-core/internal/infrastructure/extension"
"github.com/samcharles93/archie-core/internal/secret"
@@ -195,13 +196,13 @@ func (r *Runner) Close() { r.host.Close() }
// is retried each tick; it never stops the caller. The returned Runner's Close
// stops the engines.
func Supervise(ctx context.Context, registry *secret.Registry, source Source, process string, report func(ctx context.Context, version int64, err error), log *slog.Logger) *Runner {
cache, err := os.UserCacheDir()
cache, err := configuration.DefaultCacheDir()
if err != nil {
log.Warn("secret engines unavailable: no cache directory", "err", err)
return &Runner{host: extension.NewHost(hclog.NewNullLogger())}
}
host := extension.NewHost(hclog.New(&hclog.LoggerOptions{Name: "extension", Level: hclog.Warn}))
runner := NewRunner(host, registry, source, filepath.Join(cache, "archie", "extensions", process), log)
runner := NewRunner(host, registry, source, filepath.Join(cache, "extensions", process), log)
runner.ReportTo(report)
if err := runner.Sync(ctx); err != nil {
log.Warn("secret engines", "err", err)