Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/extension/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ type Image struct {
Registry string `json:"registry"`
Name string `json:"name"`
Version string `json:"version"`
Mapped *Image `json:"mapped,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory external binaries could return values with deeply-nested images, but I believe it's fine because we're only interested in the first level. The other options is to make it flat, but I can go either way.

@smg247 @stbenjam thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to elaborate on what Fabio said. If the deeply-nested struct is not acceptable, we can do flat struct like this:

type Image struct {
	Index    int         `json:"index"`
	Registry string      `json:"registry"`
	Name     string      `json:"name"`
	Version  string      `json:"version"`
	Mapped   MappedImage `json:"mapped,omitempty"`
}

type MappedImage struct {
	Index    int    `json:"index"`
	Registry string `json:"registry"`
	Name     string `json:"name"`
	Version  string `json:"version"`
}

}