Added format parameter to sync command

Signed-off-by: Brendan Aye <brendan.aye@t-mobile.com>
This commit is contained in:
Brendan Aye
2021-04-23 12:59:19 -07:00
parent ad9f1d7bb9
commit 7898ffaf23
9 changed files with 143 additions and 28 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"time"
"github.com/containers/image/v5/manifest"
"github.com/go-check/check"
)
@@ -200,3 +201,11 @@ func runDecompressDirs(c *check.C, regexp string, args ...string) {
c.Assert(string(out), check.Matches, "(?s)"+regexp) // (?s) : '.' will also match newlines
}
}
// Verify manifest in a dir: image at dir is expectedMIMEType.
func verifyManifestMIMEType(c *check.C, dir string, expectedMIMEType string) {
manifestBlob, err := ioutil.ReadFile(filepath.Join(dir, "manifest.json"))
c.Assert(err, check.IsNil)
mimeType := manifest.GuessMIMEType(manifestBlob)
c.Assert(mimeType, check.Equals, expectedMIMEType)
}