This commit updates ibcli for the new API in images for the
`reporegistry.New()`. The main incompatible change is that the
`/repositories` part is not longer automatically added inside
the library so we need to add it on the call-site.
This needs https://github.com/osbuild/images/pull/1179
This commit fixes the issue that on `CTRL-C` (SIGINT) the progress
is not properly cleared. It also catches SIGTERM for good measure.
No test right now as this is hard to test automatically :/
Closes: https://github.com/osbuild/image-builder-cli/issues/123
This commit fixes the issue that the auto-detect distro is not
visible in the progress message. It also tweaks the order of
the message to show:
```
Building manifest for <distro>-<img-type>
```
to be more conistent.
Closes: https://github.com/osbuild/image-builder-cli/issues/121
Since our upstream repository name differs from the downstream name we
should set the `downstream_package_name` [1] config option.
[1]: https://packit.dev/docs/configuration#downstream_package_name
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
We received a commit downstream by Björn Esser. After asking around for
the reasoning behind the commit it seems that we're likely assuming that
this package is available in the buildroot.
Let's depend on it explicitly instead of assuming it is there.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit adds a new `describe-image` comamnd that contains
the details about the given image type. The output is yaml as
it is both nicely human readable and also machine readable.
Note that this version carries an invalid yaml header on
purpose to avoid people replying on the feature for scripts
before it is stable.
The output looks like this:
```yaml
$ ./image-builder describe-image rhel-9.1 tar
@WARNING - the output format is not stable yet and may change
distro: rhel-9.1
type: tar
arch: x86_64
os_vesion: "9.1"
bootmode: none
partition_type: ""
default_filename: root.tar.xz
packages:
include:
- policycoreutils
- selinux-policy-targeted
- selinux-policy-targeted
exclude:
- rng-tools
```
Thanks to Ondrej Budai for the idea and the example.
Supply initial documentation for `image-builder`. This documentation
will be imported into the osbuild [1] website.
[1]: https://osbuild.org/
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit silences logrus logging for now by just dicarding
everything from it. The rational is that the underlying libraries
produce a lot of output, e.g. every build currently results in
```console
$ image-builder build qcow2
WARN[0000] Failed to load consumer certs: no consumer key found
...
```
which is confusing to our users. What is worse is that containers
also uses logrus so we can get random warnings without context
from there too. Until we have a way to filter log messages this
seems to be the most practical way.
We can add `--verbose` or `--debug` later to enable these kinds
of messages.
This commit tweaks the help output for the manifest and build
commands to make clear that only the image type is a required
argument but the rest can be overriden via extra flags.
Thanks to Achilleas for noticing.
This commit changes the build to not build with CGO. There is really
no need to build with CGO, we only need it for the `crypt()` version
in the images library. However since with the merge of
https://github.com/osbuild/images/pull/1114
that is no longer an issue.
This commit updates the tests for the error reporting. Since
we are now using the new "progress" module we can no longer
directly mock osStderr. So this now uses the new testutil
helper `CaptureStdio`.
Note also that the behavior of `verbose` and `term` is slightly
different - for backward compatibility in `verbose` mode the
stderr from osbuild is directly connected to the caller stderr.
For term mode this is not done to prevent spurious message from
leaking into the terminal progress and the full error is available
from the actual go error as captured output.
This commit adds a new testutil.CaptureStdio helper so that we
can test external go modules that use os.Std{out,err} but now
allow mocking or overwriting.
This commit checks that the `--progress` argument generates the
expected output, i.e. with `term` we will not get any osbuild
output and the spinner. And with `verbose` we will not get a
spinner and the osbuild output.
This is a very sad commit, it copies the code to make a fake
container with a faked osbuild.
The bright side is that the plan is to rewrite these helpers
in go and then we can just have a shared testutil module that
can be imported from both bib/ibcli.
And/or the two repos will merge and its just a (simple) test
helper. But I do not feel good (at all) about this.
This commit add progress reporting similar to what `bib` is doing.
It imports the progress from `bootc-image-builder` for now. There
is an open PR for moving this to images but there are some
concerns about moving it there so for now we just use bib.
This is not too bad because eventually bib and ibcli will merge.
This now precreates the directory as it's possible that the directory
doesn't exist yet at this point; see #94.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Having this test triggers the conditions for #94. This test case is
failing and the next commit fixes the bug.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
For some reason on a bunch of my systems `platform.processor()` always
returns an empty string. `platform.machine()` consistently works on
those systems.
This closes#95.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Running the tests inside fedora means we get much more meaningful
results as we will have all the required packaes and there will
be no need to skip tests.
When reading `--blueprint string`, I briefly thought it might
also be possible to put a whole blueprint content as string
into image-builder-cli argument.
This wording should avoid misunderstandings.
Use go-vendor-tools to generate the license identifiers for our vendored
code. This initial commit does not yet apply the rest of go-vendor-tools
abilities to manage the vendoring itself.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>