Update imagetxt to align with 0.3, add tests; make content image type public

This commit is contained in:
Matt Nikkel
2022-03-07 19:58:23 -05:00
parent 2165c54508
commit 5cb6a5ef60
6 changed files with 248 additions and 26 deletions
+6 -6
View File
@@ -8,9 +8,9 @@ import (
"github.com/rancherfederal/hauler/pkg/artifact"
)
var _ artifact.OCI = (*image)(nil)
var _ artifact.OCI = (*Image)(nil)
func (i *image) MediaType() string {
func (i *Image) MediaType() string {
mt, err := i.Image.MediaType()
if err != nil {
return ""
@@ -18,15 +18,15 @@ func (i *image) MediaType() string {
return string(mt)
}
func (i *image) RawConfig() ([]byte, error) {
func (i *Image) RawConfig() ([]byte, error) {
return i.RawConfigFile()
}
type image struct {
type Image struct {
gv1.Image
}
func NewImage(ref string) (*image, error) {
func NewImage(ref string) (*Image, error) {
r, err := name.ParseReference(ref)
if err != nil {
return nil, err
@@ -37,7 +37,7 @@ func NewImage(ref string) (*image, error) {
return nil, err
}
return &image{
return &Image{
Image: img,
}, nil
}