Refactor: local images should be v1.Images #238
Merged
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.
Partially resolves #207
Introduces a
locallayout
package and a newimgutil.CNBImage
struct.The
CNBImage
struct wraps av1.Image
, which could belocallayout
,remote
,layout
, etc. and performs all the modifications to the image that are necessary for a CNB build (such as re-using a layer from a previous image).locallayout.Image
implements av1.Image
by wrapping output from the daemon. However, it does not contain any CNB logic. It does have code that is specific to constructing new images and saving them to the daemon.This should eventually allow us to delete duplicated code in the
remote
&layout
packages that modifies images in those packages, as we can remove all of the CNB logic (and then some).Additionally, this should make it easier for us to send images to the daemon in OCI layout format.
This PR simply adds code but if
locallayout.Image
works well in place oflocal.Image
we can removelocal
.