Skip to content

Commit 7569725

Browse files
authored
Fixed storage-credentials list command in text output (#1094)
## Changes Fixes #1029 Closes #910 ## Tests Added regression test
1 parent 3972d24 commit 7569725

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

cmd/workspace/storage-credentials/overrides.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
func listOverride(listCmd *cobra.Command) {
99
listCmd.Annotations["template"] = cmdio.Heredoc(`
1010
{{header "ID"}} {{header "Name"}} {{header "Credentials"}}
11-
{{range .}}{{.Id|green}} {{.Name|cyan}} {{if .AwsIamRole}}{{.AwsIamRole.RoleArn}}{{end}}{{if .AzureServicePrincipal}}{{.AzureServicePrincipal.ApplicationId}}{{end}}{{if .GcpServiceAccountKey}}{{.Email}}{{end}}
11+
{{range .}}{{.Id|green}} {{.Name|cyan}} {{if .AwsIamRole}}{{.AwsIamRole.RoleArn}}{{end}}{{if .AzureServicePrincipal}}{{.AzureServicePrincipal.ApplicationId}}{{end}}{{if .DatabricksGcpServiceAccount}}{{.DatabricksGcpServiceAccount.Email}}{{end}}
1212
{{end}}`)
1313
}
1414

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package internal
2+
3+
import (
4+
"testing"
5+
6+
"github.com/databricks/cli/internal/acc"
7+
"github.com/stretchr/testify/assert"
8+
)
9+
10+
func TestStorageCredentialsListRendersResponse(t *testing.T) {
11+
_, _ = acc.WorkspaceTest(t)
12+
stdout, stderr := RequireSuccessfulRun(t, "storage-credentials", "list")
13+
assert.NotEmpty(t, stdout)
14+
assert.Empty(t, stderr)
15+
}

0 commit comments

Comments
 (0)