Skip to content

Commit

Permalink
incorporate feedback from PR review
Browse files Browse the repository at this point in the history
Signed-off-by: nithyatsu <[email protected]>
  • Loading branch information
nithyatsu committed Jul 29, 2024
1 parent 3a8403f commit e5a88a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions pkg/cli/cmd/credential/show/objectformats.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func credentialFormatAWSAccessKey() output.FormatterOptions {
Heading: "REGISTERED",
JSONPath: "{ .Enabled }",
},
{
Heading: "KIND",
JSONPath: "{ .AWSCredentials.Kind }",
},
{
Heading: "ACCESSKEYID",
JSONPath: "{ .AWSCredentials.AccessKey.AccessKeyID }",
Expand All @@ -104,6 +108,10 @@ func credentialFormatAWSIRSA() output.FormatterOptions {
Heading: "REGISTERED",
JSONPath: "{ .Enabled }",
},
{
Heading: "KIND",
JSONPath: "{ .AWSCredentials.Kind }",
},
{
Heading: "ROLEARN",
JSONPath: "{ .AWSCredentials.IRSA.RoleARN }",
Expand Down
8 changes: 4 additions & 4 deletions pkg/cli/cmd/credential/show/objectformats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Test_credentialFormat_Azure_WorkloadIdentity(t *testing.T) {
require.Equal(t, expected, buffer.String())
}

func Test_credentialFormat_AWS_AcessKey(t *testing.T) {
func Test_credentialFormatAWSAccessKey(t *testing.T) {
obj := credential.ProviderCredentialConfiguration{
CloudProviderStatus: credential.CloudProviderStatus{
Name: "test",
Expand All @@ -97,11 +97,11 @@ func Test_credentialFormat_AWS_AcessKey(t *testing.T) {
err := output.Write(output.FormatTable, obj, buffer, credentialFormatOutput)
require.NoError(t, err)

expected := "NAME REGISTERED ACCESSKEYID\ntest true test-access-key-id\n"
expected := "NAME REGISTERED KIND ACCESSKEYID\ntest true AccessKey test-access-key-id\n"
require.Equal(t, expected, buffer.String())
}

func Test_credentialFormat_AWS_IRSA(t *testing.T) {
func Test_credentialFormatAWSIRSA(t *testing.T) {
obj := credential.ProviderCredentialConfiguration{
CloudProviderStatus: credential.CloudProviderStatus{
Name: "test",
Expand All @@ -122,6 +122,6 @@ func Test_credentialFormat_AWS_IRSA(t *testing.T) {
err := output.Write(output.FormatTable, obj, buffer, credentialFormatOutput)
require.NoError(t, err)

expected := "NAME REGISTERED ROLEARN\ntest true test-role-arn\n"
expected := "NAME REGISTERED KIND ROLEARN\ntest true IRSA test-role-arn\n"
require.Equal(t, expected, buffer.String())
}

0 comments on commit e5a88a0

Please sign in to comment.