This repository was archived by the owner on Sep 1, 2026. It is now read-only.
renaming arguments - #82
Merged
Merged
Conversation
Closes #77.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Split out `--extra-artifacts` into `--with-sbom` and `--with-manifest`. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
mvo5
previously approved these changes
Jan 20, 2025
mvo5
left a comment
Contributor
There was a problem hiding this comment.
Thank you, lets merge it to unblock fedora
Contributor
|
Meh, sorry, actually - we need to update the README too I think |
schuellerf
previously approved these changes
Jan 20, 2025
schuellerf
left a comment
Contributor
There was a problem hiding this comment.
LGTM, despite my comment
mvo5
reviewed
Jan 20, 2025
|
|
||
| var extraArtifacts []string | ||
|
|
||
| if withSBOM { |
Contributor
There was a problem hiding this comment.
If there is a new push required, lets add:
diff --git a/cmd/image-builder/main.go b/cmd/image-builder/main.go
index 43af781..14bb9fc 100644
--- a/cmd/image-builder/main.go
+++ b/cmd/image-builder/main.go
@@ -133,18 +133,12 @@ func cmdManifestWrapper(cmd *cobra.Command, args []string, w io.Writer, archChec
}
}
- var extraArtifacts []string
-
- if withSBOM {
- extraArtifacts = append(extraArtifacts, "sbom")
- }
-
opts := &manifestOptions{
- OutputDir: outputDir,
- BlueprintPath: blueprintPath,
- Ostree: ostreeImgOpts,
- RpmDownloader: rpmDownloader,
- ExtraArtifacts: extraArtifacts,
+ OutputDir: outputDir,
+ BlueprintPath: blueprintPath,
+ Ostree: ostreeImgOpts,
+ RpmDownloader: rpmDownloader,
+ WithSBOM: withSBOM,
}
err = generateManifest(dataDir, img, w, opts)
return img, err
diff --git a/cmd/image-builder/manifest.go b/cmd/image-builder/manifest.go
index eb8fc83..2604c6f 100644
--- a/cmd/image-builder/manifest.go
+++ b/cmd/image-builder/manifest.go
@@ -4,7 +4,6 @@ import (
"io"
"os"
"path/filepath"
- "slices"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/imagefilter"
@@ -16,11 +15,12 @@ import (
)
type manifestOptions struct {
- OutputDir string
- BlueprintPath string
- Ostree *ostree.ImageOptions
- RpmDownloader osbuild.RpmDownloader
- ExtraArtifacts []string
+ OutputDir string
+ BlueprintPath string
+ Ostree *ostree.ImageOptions
+ RpmDownloader osbuild.RpmDownloader
+
+ WithSBOM bool
}
func sbomWriter(outputDir, filename string, content io.Reader) error {
@@ -46,7 +46,7 @@ func generateManifest(dataDir string, img *imagefilter.Result, output io.Writer,
Output: output,
RpmDownloader: opts.RpmDownloader,
}
- if slices.Contains(opts.ExtraArtifacts, "sbom") {
+ if opts.WithSBOM {
outputDir := opts.OutputDir
if outputDir == "" {
outputDir = outputNameFor(img)
Contributor
There was a problem hiding this comment.
But I can do it in a followup if time is of the essence
Member
Author
There was a problem hiding this comment.
I'll add a commit for this.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Remove all slice operations. Co-authored-by: Michael Vogt <michael.vogt@gmail.com> Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
supakeen
force-pushed
the
renaming-arguments
branch
from
January 20, 2025 15:31
2dab18e to
5dc2ff7
Compare
mvo5
reviewed
Jan 20, 2025
| [osbuild](https://github.com/osbuild/osbuild) manifest will be | ||
| placed in the output directory too. | ||
|
|
||
| With the `--with-sbom` option an SPDX SBOM document will be |
Contributor
There was a problem hiding this comment.
There is a ### SBOMs section in the README a little bit below that would also need this update
Member
Author
There was a problem hiding this comment.
Ah yea, I had just spotted that one as well; I've adjusted the last commit to also change it there.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
supakeen
force-pushed
the
renaming-arguments
branch
from
January 20, 2025 15:38
5dc2ff7 to
3437aaa
Compare
mvo5
approved these changes
Jan 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR, after some discussion with @achilleas-k, @schuellerf, and @mvo5 to rename some arguments.
This PR:
--storeto--cache(#77).--extra-artifacts