ctr: return explicit errors for flags unsupported by transfer service
ctr currently silently ignores several flags by default (without --local) and the user can't know which flags are supported until they see the code. This commit fixes ctr to return an explicit error when it finds an unsupported flag. Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
@@ -100,6 +100,15 @@ command. As part of this process, we do the following:
|
||||
defer cancel()
|
||||
|
||||
if !context.Bool("local") {
|
||||
unsupportedFlags := []string{"max-concurrent-downloads", "print-chainid",
|
||||
"skip-verify", "tlscacert", "tlscert", "tlskey", "http-dump", "http-trace", // RegistryFlags
|
||||
}
|
||||
for _, s := range unsupportedFlags {
|
||||
if context.IsSet(s) {
|
||||
return fmt.Errorf("\"--%s\" requires \"--local\" flag", s)
|
||||
}
|
||||
}
|
||||
|
||||
ch, err := commands.NewStaticCredentials(ctx, context, ref)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user