Skip to content

Commit

Permalink
attempt
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Apr 2, 2024
1 parent 2b170c7 commit e397e3b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/e2e/suite/command/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,29 @@ var _ = Describe("Remote registry users:", func() {
Size: int64(foobar.FileConfigSize),
Digest: foobar.FileConfigDigest,
}))

// new test
It("should pack with spec v1.0 when --config is used, --artifactType is not given and --image-spec set to auto", func() {
repo := pushTestRepo("my/test/repo")
configType := "my/config/type"
tempDir := PrepareTempFiles()

ORAS("push", RegistryRef(ZOTHost, repo, tag), "--config", fmt.Sprintf("%s:%s", foobar.FileConfigName, configType), foobar.FileBarName, "-v").
MatchStatus([]match.StateKey{
{Digest: foobar.FileConfigStateKey.Digest, Name: configType},
foobar.FileBarStateKey,
}, true, 2).
WithWorkDir(tempDir).Exec()
// validate
fetched := ORAS("manifest", "fetch", RegistryRef(ZOTHost, repo, tag)).Exec().Out.Contents()
var manifest ocispec.Manifest
Expect(json.Unmarshal(fetched, &manifest)).ShouldNot(HaveOccurred())
Expect(manifest.Config).Should(Equal(ocispec.Descriptor{
MediaType: configType,
Size: int64(foobar.FileConfigSize),
Digest: foobar.FileConfigDigest,
}))

})

It("should push files with customized manifest annotation", func() {
Expand Down

0 comments on commit e397e3b

Please sign in to comment.