containerd / imgcrypt

OCI Image Encryption Package
Apache License 2.0
355 stars 46 forks source link

Facing issues of go mod tidy #156

Open soniarshika opened 4 months ago

soniarshika commented 4 months ago

arsh@meAI:~$ go version go version go1.21.9 linux/amd64

arsh@meAI:~$ cd imgcrypt/

arsh@meAI:~/imgcrypt$ make cd cmd && go build -o ../bin/ctd-decoder -v ./ctd-decoder/ go: updates to go.mod needed; to update it: go mod tidy make: *** [Makefile:37: bin/ctd-decoder] Error 1

I am facing the above error whiile running make command. would appreciate if someone knows how can i resolve this?

stefanberger commented 4 months ago

For me it works and our test cases running on github CI also don't run into this problem.

[stefanb@... containerd]$ cd imgcrypt/
[stefanb@... imgcrypt]$ go version
go version go1.21.9 linux/amd64
[stefanb@... imgcrypt]$ git diff
[stefanb@... imgcrypt]$ git branch
* main
[stefanb@... imgcrypt]$ make
go build -o bin/ctd-decoder -v ./cmd/ctd-decoder/
go build -o bin/ctr-enc -ldflags '-X github.com/containerd/containerd/version.Version=v1.1.10' -v ./cmd/ctr/

Is your check clean? Try git reset --hard origin/main.

soniarshika commented 4 months ago

Yes it worked, but now after encrypting the image am unable to run this image. Facing the errror:

arsh@meAI:~/imgcrypt$ sudo ctr container create docker.io/arshika/test-repo:v5.2  arshika_image1
INFO[0000] apply failure, attempting cleanup             error="failed to extract layer sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645: read payload: read configFd: bad file descriptor\n: unknown" key="extract-356629224-sZl7 sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645"
ctr: failed to extract layer sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645: read payload: read configFd: bad file descriptor
: unknown

Also i tried running:

arsh@meAI:~/imgcrypt$ sudo ctr-enc run --rm --key mykey.pem docker.io/arshika/test-repo:v5.2  test echo 'Hello World!'
[sudo] password for arsh: 
INFO[0000] apply failure, attempting cleanup             error="failed to extract layer sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645: unable to get decryption keys in provided key path: Unknown decryption key type\n: unknown" key="extract-680227959-eVmp sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645"
ctr: failed to extract layer sha256:3c8879ab2cf25eb049af95711715b5b99d97490ab4eedbe8d0f160f53ef5a645: unable to get decryption keys in provided key path: Unknown decryption key type
: unknown
stefanberger commented 4 months ago

Please provide all the command lines you are running. Otherwise it's nearly impossible to figure out what you doing.