[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Add -c / --container flag to images #603

Merged
merged 5 commits into from
Aug 26, 2022

Conversation

cloudnautique
Copy link
Member

The new flags show the container images that are a part of the Acorn
image.

acorn images:

REPOSITORY                          TAG              IMAGE-ID
ghcr.io/acorn-io/library/registry   v2.8.1-acorn.1   c041941788cb
monitoring-operator                 latest           c3a97c6e0d4f
ghcr.io/acorn-io/library/mariadb    latest           6a447c6a81c2
acorn images -c
REPOSITORY                          TAG              CONTAINER                   DIGEST
ghcr.io/acorn-io/library/registry   v2.8.1-acorn.1   registry                    sha256:4562d45e6464f3d730e3df444e907a17bb1d85c1c59e701af4d0b1ef4b9ae23e
ghcr.io/acorn-io/library/registry   v2.8.1-acorn.1   htpasswd-create             sha256:b9ae2b67047a0f4e1963f6b1c2ba5935919de1fddc441a1215a64693cc9c4c90
monitoring-operator                 latest           prom                        sha256:ef691daf5c0961759efcbaf6fa6dba37ea5e138e1447245fa9f10fdd71841f1d
monitoring-operator                 latest           acorn-file-init             sha256:5d17873afc03589bfe09361aee3207ce3e30736282060daf222158cc9bec20db
monitoring-operator                 latest           acorn-monitoring-operator   sha256:7211be2296b7642aaec786ae05288a3b9564770de2c621d3373433d263dd9302
ghcr.io/acorn-io/library/mariadb    latest           mariadb-0                   sha256:2d2b4f1128dd88aae18f5b79e773ebba3f5d7187434588287d0c90398901b81a
ghcr.io/acorn-io/library/mariadb    latest           backup                      sha256:5e5d4802b2013ae044aa90161c844cb7fd25a2c79ded77ad514a89e5113fcf7a
ghcr.io/acorn-io/library/mariadb    latest           restore-from-backup         sha256:5e5d4802b2013ae044aa90161c844cb7fd25a2c79ded77ad514a89e5113fcf7a

Signed-off-by: Bill Maxwell cloudnautique@users.noreply.github.com

@cloudnautique
Copy link
Member Author
cloudnautique commented Aug 22, 2022

I'm not sure this is the right way to handle it, and there is an issue where it throws this error:
acorn images -a -c [346/23755831] 0% | 0s ERRO[0002] repository can only contain the characters abcdefghijklmnopqrstuvwxyz0123456789_-./: acorn-io/library/registry:latest@sha256

I think pull is only looking for the tag, and doesn't expect the for the layer of the nested Acorn. I assume we could handle this when the image is originally pulled. I'm just not sure where/how to do that.

If it can't be handled during the initial pull, it would be good to get it from the local registry, I assume it is there someplace.

@cloudnautique
Copy link
Member Author

This is updated to use the correct name for the nested Acorn image and avoids any type of pull/lookup of the image.

return out.Err()
}

type ImageContainer struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you unexport this (imageContainer) but keep the fields exported and see if it'll still work? I'm not 100% sure whether it will or not, but would be nice to keep it unexported if we can.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agreed. It's only needed for looping through all of this.

The new flags show the container images that are a part of the Acorn
image.

Signed-off-by: Bill Maxwell <cloudnautique@users.noreply.github.com>
Signed-off-by: Bill Maxwell <cloudnautique@users.noreply.github.com>
Signed-off-by: Bill Maxwell <cloudnautique@users.noreply.github.com>
Signed-off-by: Bill Maxwell <cloudnautique@users.noreply.github.com>
Signed-off-by: Bill Maxwell <cloudnautique@users.noreply.github.com>
@cloudnautique
Copy link
Member Author

The output for -c now displays the IMAGE-ID column so that untagged Acorn images containers can be displayed and tied back to the Acorn image. When doing quiet mode, the repo is set to <none> to provide the indication it is unknown. The Image-id is used as the TAG field in quiet mode. Behind the scenes it looks like Acorn is using <internal registry>/acorn/ns:ID. The Tag being set to the ID seems to be consistent.

New Output:

acorn images
#REPOSITORY                          TAG       IMAGE-ID
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff
#
acorn images -c
#REPOSITORY                          TAG       IMAGE-ID                                                                                                           CONTAINER         DIGEST
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff                                                                                                       registry          sha256:1ea1b40d2a72e41d37b5a8d22552c89ad847600c9fed29a22b5446ae91d9e88a
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff                                                                                                       htpasswd-create   sha256:18eac8138e63f223f3e695494c11b0c49478cc59024780d004827fbd5bd0d86e
#ghcr.io/acorn-io/library/registry   latest    ghcr.io/acorn-io/library/registry:latest@sha256:363c28df7ed04e8a8813d558b696a0b010646f3021b25159696721d354732e95   redis-0-0         sha256:a9c957fd95370e75a266c926a2b740fbab4a28d7408ad29b1b9be8e2bd722f36
acorn images -a
#REPOSITORY                          TAG       IMAGE-ID
#<none>                              <none>    2524a1a8c667
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff

acorn images -c -a
#REPOSITORY                          TAG       IMAGE-ID                                                                                                           CONTAINER                   DIGEST
#<none>                              <none>    2524a1a8c667                                                                                                       prom                        sha256:ef691daf5c0961759efcbaf6fa6dba37ea5e138e1447245fa9f10fdd71841f1d
#<none>                              <none>    2524a1a8c667                                                                                                       acorn-file-init             sha256:b97a089c9869ffe80cf80942ec81fa3dbc0bca751f9b677f3875edf841105232
#<none>                              <none>    2524a1a8c667                                                                                                       acorn-monitoring-operator   sha256:7d34aa6fc9374b39f35cd3e77705651a60b9286aee9564131b84096592968146
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff                                                                                                       registry                    sha256:1ea1b40d2a72e41d37b5a8d22552c89ad847600c9fed29a22b5446ae91d9e88a
#ghcr.io/acorn-io/library/registry   latest    ddf2840f12ff                                                                                                       htpasswd-create             sha256:18eac8138e63f223f3e695494c11b0c49478cc59024780d004827fbd5bd0d86e
#ghcr.io/acorn-io/library/registry   latest    ghcr.io/acorn-io/library/registry:latest@sha256:363c28df7ed04e8a8813d558b696a0b010646f3021b25159696721d354732e95   redis-0-0                   sha256:a9c957fd95370e75a266c926a2b740fbab4a28d7408ad29b1b9be8e2bd722f36
acorn images -c -q
#ghcr.io/acorn-io/library/registry:latest@sha256:1ea1b40d2a72e41d37b5a8d22552c89ad847600c9fed29a22b5446ae91d9e88a
#ghcr.io/acorn-io/library/registry:latest@sha256:18eac8138e63f223f3e695494c11b0c49478cc59024780d004827fbd5bd0d86e
#ghcr.io/acorn-io/library/registry:latest@sha256:a9c957fd95370e75a266c926a2b740fbab4a28d7408ad29b1b9be8e2bd722f36

acorn images -c -q -a
#<none>:2524a1a8c667aa80e8319f4741861ca2f60f046d2f52ebb59c0131115cec2b53@sha256:ef691daf5c0961759efcbaf6fa6dba37ea5e138e1447245fa9f10fdd71841f1d
#<none>:2524a1a8c667aa80e8319f4741861ca2f60f046d2f52ebb59c0131115cec2b53@sha256:b97a089c9869ffe80cf80942ec81fa3dbc0bca751f9b677f3875edf841105232
#<none>:2524a1a8c667aa80e8319f4741861ca2f60f046d2f52ebb59c0131115cec2b53@sha256:7d34aa6fc9374b39f35cd3e77705651a60b9286aee9564131b84096592968146
#ghcr.io/acorn-io/library/registry:latest@sha256:1ea1b40d2a72e41d37b5a8d22552c89ad847600c9fed29a22b5446ae91d9e88a
#ghcr.io/acorn-io/library/registry:latest@sha256:18eac8138e63f223f3e695494c11b0c49478cc59024780d004827fbd5bd0d86e
#ghcr.io/acorn-io/library/registry:latest@sha256:a9c957fd95370e75a266c926a2b740fbab4a28d7408ad29b1b9be8e2bd722f36

@cloudnautique cloudnautique merged commit ee60c35 into acorn-io:main Aug 26, 2022
@cloudnautique cloudnautique deleted the image_scanning_test branch August 26, 2022 17:48
@cjellick cjellick modified the milestone: v0.2.0 Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants