Carry dependencies through operator commands

This commit is contained in:
2026-09-05 18:00:50 +00:00
parent dd905c4daa
commit f51b9bb046
17 changed files with 182 additions and 172 deletions

View File

@@ -10,6 +10,11 @@ import (
// ArtifactsList lists effective artifact sources.
func ArtifactsList(ctx context.Context, args []string, out io.Writer) error {
return artifactsListWithDependencies(ctx, args, out, commandDependencies{})
}
func artifactsListWithDependencies(ctx context.Context, args []string, out io.Writer, deps commandDependencies) error {
deps = normalizeCommandDependencies(deps)
fs := flag.NewFlagSet("artifacts list", flag.ContinueOnError)
fs.SetOutput(io.Discard)
var flags commonConfigFlags
@@ -22,7 +27,7 @@ func ArtifactsList(ctx context.Context, args []string, out io.Writer) error {
if strings.TrimSpace(flags.sessionID) == "" {
return fmt.Errorf("artifacts list: session_id is required")
}
cfg, store, locks, m, cleanup, err := loadHelperContext(ctx, flags, remote)
cfg, store, locks, m, cleanup, err := loadHelperContextWithDependencies(ctx, flags, remote, deps)
if err != nil {
return fmt.Errorf("artifacts list: %w", err)
}
@@ -33,7 +38,7 @@ func ArtifactsList(ctx context.Context, args []string, out io.Writer) error {
}
publishedRemoteState := map[string]string{}
if remote && store != nil {
current := inspectRemoteCurrentState(ctx, cfg, store)
current := inspectRemoteCurrentStateWithDependencies(ctx, cfg, store, deps)
if current.Err != nil {
publishedRemoteState = unresolvedRemotePublishedOutputAvailability(cfg, catalog, "remote=error")
} else {