main: eat depsolve warnings
When running `image-builder` warnings are emitted during manifest generation. Depending on the definitions or customizations packages can be excluded from groups which leads to: ``` No match for group package "dracut-config-rescue" ``` Interspersing with normal output. Let's pass along another byte buffer for the warnings from manifest generation to be written into. Note that this also needs plumbing [1] to land in `images` first. [1]: https://github.com/osbuild/images/pull/1384 Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
parent
bda86863ff
commit
ad9943e99d
2 changed files with 13 additions and 9 deletions
|
|
@ -101,7 +101,7 @@ type cmdManifestWrapperOptions struct {
|
|||
useBootstrapIfNeeded bool
|
||||
}
|
||||
|
||||
func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []string, w io.Writer, wrapperOpts *cmdManifestWrapperOptions) (*imagefilter.Result, error) {
|
||||
func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []string, w io.Writer, wd io.Writer, wrapperOpts *cmdManifestWrapperOptions) (*imagefilter.Result, error) {
|
||||
if wrapperOpts == nil {
|
||||
wrapperOpts = &cmdManifestWrapperOptions{}
|
||||
}
|
||||
|
|
@ -207,7 +207,7 @@ func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []st
|
|||
fmt.Fprintf(os.Stderr, "WARNING: using experimental cross-architecture building to build %q\n", img.Arch.Name())
|
||||
}
|
||||
|
||||
err = generateManifest(dataDir, extraRepos, img, w, opts)
|
||||
err = generateManifest(dataDir, extraRepos, img, w, wd, opts)
|
||||
return img, err
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ func cmdManifest(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = cmdManifestWrapper(pbar, cmd, args, osStdout, nil)
|
||||
_, err = cmdManifestWrapper(pbar, cmd, args, osStdout, osStderr, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -287,7 +287,10 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
|
|||
opts := &cmdManifestWrapperOptions{
|
||||
useBootstrapIfNeeded: true,
|
||||
}
|
||||
res, err := cmdManifestWrapper(pbar, cmd, args, &mf, opts)
|
||||
|
||||
// We discard any warnings from the depsolver until we figure out a better
|
||||
// idea (likely in manifestgen)
|
||||
res, err := cmdManifestWrapper(pbar, cmd, args, &mf, io.Discard, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,17 +46,18 @@ func sbomWriter(outputDir, filename string, content io.Reader) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func generateManifest(dataDir string, extraRepos []string, img *imagefilter.Result, output io.Writer, opts *manifestOptions) error {
|
||||
func generateManifest(dataDir string, extraRepos []string, img *imagefilter.Result, output io.Writer, depsolveWarningsOutput io.Writer, opts *manifestOptions) error {
|
||||
repos, err := newRepoRegistry(dataDir, extraRepos)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// XXX: add --rpmmd/cachedir option like bib
|
||||
manifestGenOpts := &manifestgen.Options{
|
||||
Output: output,
|
||||
RpmDownloader: opts.RpmDownloader,
|
||||
UseBootstrapContainer: opts.UseBootstrapContainer,
|
||||
CustomSeed: opts.CustomSeed,
|
||||
Output: output,
|
||||
DepsolveWarningsOutput: depsolveWarningsOutput,
|
||||
RpmDownloader: opts.RpmDownloader,
|
||||
UseBootstrapContainer: opts.UseBootstrapContainer,
|
||||
CustomSeed: opts.CustomSeed,
|
||||
}
|
||||
if opts.WithSBOM {
|
||||
outputDir := basenameFor(img, opts.OutputDir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue