Skip to content

Commit

Permalink
add test for fix for #544
Browse files Browse the repository at this point in the history
Signed-off-by: ashpect <ashishndiitr@gmail.com>
  • Loading branch information
ashpect committed Aug 24, 2023
1 parent 872c669 commit adb49bb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,19 @@ func TestPullImageOfBundle(t *testing.T) {
assert.Contains(t, out.String(), "Expected bundle flag when pulling a bundle (hint: Use -b instead of -i for bundles)")
})

t.Run("when --image-is-bundle-check=false is provided while using the -b flag it fails", func(t *testing.T) {
pullDir := env.Assets.CreateTempFolder("pull-bundle-image")
out := bytes.NewBufferString("")
_, err := imgpkg.RunWithOpts([]string{"pull", "--tty", "-b", randomBundle.RefDigest, "-o", pullDir, "--image-is-bundle-check=false"}, helpers.RunOpts{
AllowError: true,
StderrWriter: out,
StdoutWriter: out,
})

require.Error(t, err)
assert.Contains(t, out.String(), "Cannot set --image-is-bundle-check while using -b flag")
})

t.Run("when --image-is-bundle-check=false is provided downloads the OCI Image of the bundle", func(t *testing.T) {
pullDir := env.Assets.CreateTempFolder("pull-bundle-image")
imgpkg.RunWithOpts([]string{"pull", "--tty", "-i", randomBundle.RefDigest, "-o", pullDir, "--image-is-bundle-check=false"}, helpers.RunOpts{})
Expand Down

0 comments on commit adb49bb

Please sign in to comment.