Skip to content

Commit

Permalink
Add dry-run test for secret-ref flag
Browse files Browse the repository at this point in the history
Signed-off-by: Devanshu <[email protected]>
  • Loading branch information
devanshuVmware committed Aug 28, 2024
1 parent ae09e99 commit 598f7ea
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cli/test/e2e/package_repo_dry_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,32 @@ status:
require.Contains(t, tagSemverOutput, tagSemverExpectedOutput)
})
}

func TestPackageRepoSecretRefDryRun(t *testing.T) {
env := BuildEnv(t)
logger := Logger{}
kappCtrl := Kctrl{t, env.Namespace, env.KctrlBinaryPath, logger}

logger.Section("dry-run package repo add", func() {
expectedOutput := `apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
metadata:
creationTimestamp: null
name: test-repo
namespace: kctrl-test
spec:
fetch:
imgpkgBundle:
image: registry.carvel.dev/project/repo:1.0.0
secretRef:
name: regcred
status:
conditions: null
friendlyDescription: ""
observedGeneration: 0`

output := kappCtrl.Run([]string{"package", "repo", "add", "-r", "test-repo", "--url",
"registry.carvel.dev/project/repo:1.0.0", "--semver-tag-constraints", "1.0.0", "--secret-ref", "regcred", "--dry-run"})
require.Contains(t, output, expectedOutput)
})
}

0 comments on commit 598f7ea

Please sign in to comment.