Skip to content

Commit

Permalink
feat: alias vendored zarf to z (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
decleaver authored Feb 16, 2024
1 parent ab861be commit 823ac5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ func init() {
}

// only vendor zarf if specifically invoked
if len(os.Args) > 1 && os.Args[1] == "zarf" {
if len(os.Args) > 1 && (os.Args[1] == "zarf" || os.Args[1] == "z") {
zarfCmd := &cobra.Command{
Use: "zarf COMMAND",
Use: "zarf COMMAND",
Aliases: []string{"z"},
Run: func(cmd *cobra.Command, args []string) {
os.Args = os.Args[1:] // grab 'zarf' and onward from the CLI args
zarfCLI.Execute()
Expand Down
4 changes: 2 additions & 2 deletions src/test/e2e/variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ func TestBundleWithEnvVarHelmOverrides(t *testing.T) {
deploy(t, bundlePath)

// check override variables, ensure they are coming from env vars and take highest precedence
cmd := strings.Split("zarf tools kubectl get deploy -n podinfo unicorn-podinfo -o=jsonpath='{.spec.template.spec.containers[0].env[?(@.name==\"PODINFO_UI_COLOR\")].value}'", " ")
cmd := strings.Split("z tools kubectl get deploy -n podinfo unicorn-podinfo -o=jsonpath='{.spec.template.spec.containers[0].env[?(@.name==\"PODINFO_UI_COLOR\")].value}'", " ")
outputUIColor, _, err := e2e.UDS(cmd...)
require.Equal(t, fmt.Sprintf("'%s'", color), outputUIColor)
require.NoError(t, err)

cmd = strings.Split("zarf tools kubectl get secret test-secret -n podinfo -o jsonpath=\"{.data.test}\"", " ")
cmd = strings.Split("z tools kubectl get secret test-secret -n podinfo -o jsonpath=\"{.data.test}\"", " ")
secretValue, _, err := e2e.UDS(cmd...)
require.Equal(t, fmt.Sprintf("\"%s\"", b64Secret), secretValue)
require.NoError(t, err)
Expand Down

0 comments on commit 823ac5e

Please sign in to comment.