-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: support importing sboms along with images #567
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -46,7 +46,15 @@ | |||||
case types.OCILayer: | ||||||
fallthrough | ||||||
case types.DockerLayer: | ||||||
return importContainersImage(o.Layer.From, o.Config, o.Progress) | ||||||
err := importContainersImage(o.Layer.From, o.Config, o.Progress) | ||||||
if o.Layer.Bom != nil && o.Layer.Bom.Generate && (o.Layer.From.Type == types.DockerLayer) { | ||||||
bomPath := path.Join(o.Config.StackerDir, "artifacts", o.Name) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a common function off of |
||||||
err = getArtifact(bomPath, "application/spdx+json", o.Layer.From.Url, "", "", o.Layer.From.Insecure) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have a const for the mimetype ? |
||||||
if err != nil { | ||||||
log.Errorf("sbom for image %s not found", o.Layer.From.Url) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
} | ||||||
return err | ||||||
default: | ||||||
return errors.Errorf("unknown layer type: %v", o.Layer.From.Type) | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,8 @@ type BuildArgs struct { | |
SetupOnly bool | ||
Progress bool | ||
AnnotationsNamespace string | ||
Username string | ||
Password string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need any sort of special handling so that the value is not leaked in logs? |
||
} | ||
|
||
// Builder is responsible for building the layers based on stackerfiles | ||
|
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.
Could you add a comment w.r.t when we take this path (similar to the comment for this PR)?