Merge pull request #10321 from ktock/ctr-local-flag-deps
ctr: return explicit errors for flags unsupported by transfer service
This commit is contained in:
commit
8247b5755a
@ -115,6 +115,12 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if !context.Bool("local") {
|
if !context.Bool("local") {
|
||||||
|
unsupportedFlags := []string{"discard-unpacked-layers"}
|
||||||
|
for _, s := range unsupportedFlags {
|
||||||
|
if context.IsSet(s) {
|
||||||
|
return fmt.Errorf("\"--%s\" requires \"--local\" flag", s)
|
||||||
|
}
|
||||||
|
}
|
||||||
var opts []image.StoreOpt
|
var opts []image.StoreOpt
|
||||||
prefix := context.String("base-name")
|
prefix := context.String("base-name")
|
||||||
var overwrite bool
|
var overwrite bool
|
||||||
|
@ -100,6 +100,15 @@ command. As part of this process, we do the following:
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if !context.Bool("local") {
|
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)
|
ch, err := commands.NewStaticCredentials(ctx, context, ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -96,6 +96,16 @@ var pushCommand = &cli.Command{
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if !context.Bool("local") {
|
if !context.Bool("local") {
|
||||||
|
unsupportedFlags := []string{
|
||||||
|
"manifest", "manifest-type", "max-concurrent-uploaded-layers", "allow-non-distributable-blobs",
|
||||||
|
"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)
|
ch, err := commands.NewStaticCredentials(ctx, context, ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user