mirror of https://github.com/databricks/cli.git
Fixed storage-credentials list command in text output (#1094)
## Changes Fixes #1029 Closes #910 ## Tests Added regression test
This commit is contained in:
parent
9a1f078bd9
commit
3e6e04831f
|
@ -8,7 +8,7 @@ import (
|
|||
func listOverride(listCmd *cobra.Command) {
|
||||
listCmd.Annotations["template"] = cmdio.Heredoc(`
|
||||
{{header "ID"}} {{header "Name"}} {{header "Credentials"}}
|
||||
{{range .}}{{.Id|green}} {{.Name|cyan}} {{if .AwsIamRole}}{{.AwsIamRole.RoleArn}}{{end}}{{if .AzureServicePrincipal}}{{.AzureServicePrincipal.ApplicationId}}{{end}}{{if .GcpServiceAccountKey}}{{.Email}}{{end}}
|
||||
{{range .}}{{.Id|green}} {{.Name|cyan}} {{if .AwsIamRole}}{{.AwsIamRole.RoleArn}}{{end}}{{if .AzureServicePrincipal}}{{.AzureServicePrincipal.ApplicationId}}{{end}}{{if .DatabricksGcpServiceAccount}}{{.DatabricksGcpServiceAccount.Email}}{{end}}
|
||||
{{end}}`)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/databricks/cli/internal/acc"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestStorageCredentialsListRendersResponse(t *testing.T) {
|
||||
_, _ = acc.WorkspaceTest(t)
|
||||
stdout, stderr := RequireSuccessfulRun(t, "storage-credentials", "list")
|
||||
assert.NotEmpty(t, stdout)
|
||||
assert.Empty(t, stderr)
|
||||
}
|
Loading…
Reference in New Issue