Implemented constructors for both encryption and decryption

Signed-off-by: Brandon Lum <lumjjb@gmail.com>
This commit is contained in:
Brandon Lum
2019-07-24 16:13:26 -04:00
parent 05a2b63e84
commit 3d1fa69694
8 changed files with 194 additions and 175 deletions

View File

@@ -21,7 +21,6 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands"
imgenc "github.com/containerd/containerd/images/encryption"
encconfig "github.com/containerd/containerd/pkg/encryption/config"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -83,14 +82,12 @@ var decryptCommand = cli.Command{
return nil
}
dcparameters, err := CreateDcParameters(context, descs)
cc, err := CreateDecryptCryptoConfig(context, descs)
if err != nil {
return err
}
cc := encconfig.InitDecryption(dcparameters)
_, err = decryptImage(client, ctx, local, newName, cc, layers32, context.StringSlice("platform"))
_, err = decryptImage(client, ctx, local, newName, &cc, layers32, context.StringSlice("platform"))
return err
},