-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg: add new imagefilter
package with an ImageFilter
#1015
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about the filtering at first because I didn't consider filtering by anything new over the existing distro, arch, and type. Filtering by boot mode is interesting and it makes me wonder how far we can go. We could filter by all sorts of things, some of which might require instantiating the manifest, for example (like, to generate a partition table and check if it contains some property). And now I'm running wild with it and thinking about things like searching for image types that select for certain packages (pre-depsolve).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good, and I like that it opens many possibilities for filtering. I've added one comment, which is more of a personal coding style preference. Feel free to resolve it if you don't find it helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
This commit creates a new `imagefilter` package that can be used to create a filter for the available images that can be build by the images library. Support for prefixes and fnmatch style globbing is available. This will eventually allows us to do: ``` $ image-builder --list-images --filter arch:aarch64 --filter type:qcow* or $ image-builder --list-images --filter ami ``` The filtering can be both with or without a prefix, i.e. when doing a "simple" search all common fields (disro,arch,imageType) are checked but with a prefix search things can be narrowed down more. Initially the following prefixes filters are supported: "distro:" - the distro name, e.g. rhel-9, or fedora* "arch:" - the architecture, e.g. x86_64 "type": - the image type, e.g. ami, or qcow? "bootmode": - the bootmode, e.g. "legacy", "uefi", "hybrid" (Split out from the spike in osbuild#997)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported.
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `ibuilder` binary (name still a bit TBD but this is the best so far IMHO). This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit adds the new `image-builder` binary. This binary is meant to build images from the CLI without the need to setup a daemon. The main use-case is CI/CD and admins running this in scripts or ad-hoc. The CLI should be pleasant to use. This first commit adds the `list-images` command which is a thin wrapper around functionality from the `osbuild/images` library. It will list all buildable images by default and can be trimmed down further via `--filter` which supports the filtering from the `images` library, see osbuild/images#1015 It also supports `--output` which will output the result in the given format. Currently "text" and "json" are supported. Note that this will not work on it's own yet, it will need an installed image-builder to get the repositories. This will need to get fixed via either: 1. a dependency package for `ibuilder` that carries all the repos 2. a shared repo that contains the repos 3. using go:embed to get them (see images#1038)
This commit creates a new
imagefilter
package that can be usedto create a filter for the available images that can be build by
the images library.
Support for prefixes and fnmatch style globbing is available.
This will eventually allows us to do:
The filtering can be both with or without a prefix, i.e. when doing
a "simple" search all common fields (disro,arch,imageType) are checked
but with a prefix search things can be narrowed down more.
Initially the following prefixes filters are supported:
"distro:" - the distro name, e.g. rhel-9, or fedora*
"arch:" - the architecture, e.g. x86_64
"type": - the image type, e.g. ami, or qcow?
"bootmode": - the bootmode, e.g. "legacy", "uefi", "hybrid"
(Split out from the spike in #997)