-
Notifications
You must be signed in to change notification settings - Fork 294
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
show extensions when pack inspect #1611
Conversation
6487a7a
to
7fd3894
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1611 +/- ##
==========================================
+ Coverage 80.58% 80.63% +0.05%
==========================================
Files 156 156
Lines 10544 10508 -36
==========================================
- Hits 8496 8472 -24
+ Misses 1542 1534 -8
+ Partials 506 502 -4
Flags with carried forward coverage won't be shown. Click here to find out more. |
6fe8e77
to
d96f28e
Compare
internal/inspectimage/bom_display.go
Outdated
type BOMEntryDisplay struct { | ||
Name string `toml:"name" json:"name" yaml:"name"` | ||
Version string `toml:"version,omitempty" json:"version,omitempty" yaml:"version,omitempty"` | ||
Metadata map[string]interface{} `toml:"metadata" json:"metadata" yaml:"metadata"` | ||
Buildpack dist.ModuleRef `json:"buildpacks" yaml:"buildpacks" toml:"buildpacks"` | ||
} | ||
|
||
type BOMEntryWithExtensionDisplay struct { |
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 have the feeling that this should name BOMEntryWithExtension
? I mean, a Display contains entries of this struct, right?
internal/inspectimage/bom_display.go
Outdated
@@ -48,3 +70,31 @@ func displayBOM(bom []buildpack.BOMEntry) []BOMEntryDisplay { | |||
|
|||
return result | |||
} | |||
|
|||
func displayBOMWithExtension(bom []buildpack.BOMEntry) []BOMEntryWithExtensionDisplay { |
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.
Based on my previous comment, if the struct name is changed to BOMEntryWithExtension
then the method's name make sense to what is returning.
if info == nil { | ||
return nil | ||
return nil, &InfoWithExtensionDisplay{ |
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!
|
||
// List of extensions that passed detection, ran their generate | ||
// phases and made a contribution to this image. | ||
Extensions []buildpack.GroupElement |
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.
@itsdarshankumar I have a doubt, which problems did you face if you just add Extensions []buildpack.GroupElement
into ImageInfo
struct? I mean, it an ImageInfo
could have extension, then is this new struct totally necessary? did you face issues trying to print the output in that way? I just want to understand why do we need this new one.
Signed-off-by: Darshan Kumar <itsdarshankumar@gmail.com>
Signed-off-by: Darshan Kumar <itsdarshankumar@gmail.com>
Signed-off-by: Darshan Kumar <itsdarshankumar@gmail.com>
7228bca
to
d8f2fe2
Compare
Signed-off-by: Darshan Kumar <itsdarshankumar@gmail.com>
d8f2fe2
to
7f3951a
Compare
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 work @itsdarshankumar.
Thanks a lot for your contributions!
@@ -19,12 +19,16 @@ type BOMEntryDisplay struct { | |||
Version string `toml:"version,omitempty" json:"version,omitempty" yaml:"version,omitempty"` | |||
Metadata map[string]interface{} `toml:"metadata" json:"metadata" yaml:"metadata"` | |||
Buildpack dist.ModuleRef `json:"buildpacks" yaml:"buildpacks" toml:"buildpacks"` | |||
Extension dist.ModuleRef `json:"extensions" yaml:"extensions" toml:"extensions"` |
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 had the occasion to go back and look at this PR, and actually I don't think this is what we want. A "bom entry" is an outdated concept that only applies to buildpacks. It appears that we're basically just repeating information but under the header "extensions"... (cc @jjbustamante )
Summary
pack insepct command output should include Extensions if extensions were used while building the image
Output
Before
After
Image With Extension:
Image Without Extension:
Related
Resolves #1486