mirror of
https://github.com/containers/skopeo.git
synced 2025-08-12 11:52:39 +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()
|
encryptionKeys := opts.encryptionKeys.Value()
|
||||||
ecc, err := enchelpers.CreateCryptoConfig(encryptionKeys, []string{})
|
ecc, err := enchelpers.CreateCryptoConfig(encryptionKeys, []string{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Invalid encryption keys: %v", err)
|
||||||
}
|
}
|
||||||
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{ecc})
|
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{ecc})
|
||||||
encConfig = cc.EncryptConfig
|
encConfig = cc.EncryptConfig
|
||||||
@ -197,7 +197,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
|
|||||||
decryptionKeys := opts.decryptionKeys.Value()
|
decryptionKeys := opts.decryptionKeys.Value()
|
||||||
dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys)
|
dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Invalid decryption keys: %v", err)
|
||||||
}
|
}
|
||||||
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc})
|
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc})
|
||||||
decConfig = cc.DecryptConfig
|
decConfig = cc.DecryptConfig
|
||||||
|
Loading…
Reference in New Issue
Block a user