mirror of
https://github.com/containers/skopeo.git
synced 2025-08-01 23:07:51 +00:00
Add context to --encryption-key / --decryption-key processing failures
... to avoid context-less errors like > $ skopeo copy --decryption-key foo dir:x dir:y > FATA[0000] open foo: no such file or directory > $ skopeo copy --encryption-key /dev/null dir:x dir:y > FATA[0000] Invalid recipient format Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
8652b650b6
commit
27b3e21842
@ -186,7 +186,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
|
||||
encryptionKeys := opts.encryptionKeys.Value()
|
||||
ecc, err := enchelpers.CreateCryptoConfig(encryptionKeys, []string{})
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("Invalid encryption keys: %v", err)
|
||||
}
|
||||
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{ecc})
|
||||
encConfig = cc.EncryptConfig
|
||||
@ -197,7 +197,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
|
||||
decryptionKeys := opts.decryptionKeys.Value()
|
||||
dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("Invalid decryption keys: %v", err)
|
||||
}
|
||||
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc})
|
||||
decConfig = cc.DecryptConfig
|
||||
|
Loading…
Reference in New Issue
Block a user