Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 6ee639f

Browse files
committed
Setup scan provider before checking arg to be able to opt out
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
1 parent e588b1e commit 6ee639f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cmd/docker-scan/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ func runAuthentication(ctx context.Context, dockerCli command.Streams, flags opt
183183
}
184184

185185
func runScan(ctx context.Context, cmd *cobra.Command, dockerCli command.Cli, flags options, args []string) error {
186+
scanProvider, err := configureProvider(ctx, dockerCli, flags, provider.WithAuthConfig(func(hub *registry.IndexInfo) types.AuthConfig {
187+
return command.ResolveAuthConfig(context.Background(), dockerCli, hub)
188+
}))
186189
if len(args) != 1 {
187190
if err := cmd.Usage(); err != nil {
188191
return err
189192
}
190193
return fmt.Errorf(`"docker scan" requires exactly 1 argument`)
191194
}
192-
scanProvider, err := configureProvider(ctx, dockerCli, flags, provider.WithAuthConfig(func(hub *registry.IndexInfo) types.AuthConfig {
193-
return command.ResolveAuthConfig(context.Background(), dockerCli, hub)
194-
}))
195195
if err != nil {
196196
return err
197197
}

0 commit comments

Comments
 (0)