From 5d96335367618d1b21704f1246fce71c29118b66 Mon Sep 17 00:00:00 2001 From: nithyatsu Date: Wed, 24 Jul 2024 15:03:34 -0700 Subject: [PATCH] incorporate feedback from PR review Signed-off-by: nithyatsu --- pkg/cli/cmd/credential/show/objectformats.go | 8 ++++++++ pkg/cli/cmd/credential/show/objectformats_test.go | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/cli/cmd/credential/show/objectformats.go b/pkg/cli/cmd/credential/show/objectformats.go index f94be3c609c..b145f5c06b9 100644 --- a/pkg/cli/cmd/credential/show/objectformats.go +++ b/pkg/cli/cmd/credential/show/objectformats.go @@ -85,6 +85,10 @@ func credentialFormatAWSAccessKey() output.FormatterOptions { Heading: "REGISTERED", JSONPath: "{ .Enabled }", }, + { + Heading: "KIND", + JSONPath: "{ .AWSCredentials.Kind }", + }, { Heading: "ACCESSKEYID", JSONPath: "{ .AWSCredentials.AccessKey.AccessKeyID }", @@ -104,6 +108,10 @@ func credentialFormatAWSIRSA() output.FormatterOptions { Heading: "REGISTERED", JSONPath: "{ .Enabled }", }, + { + Heading: "KIND", + JSONPath: "{ .AWSCredentials.Kind }", + }, { Heading: "ROLEARN", JSONPath: "{ .AWSCredentials.IRSA.RoleARN }", diff --git a/pkg/cli/cmd/credential/show/objectformats_test.go b/pkg/cli/cmd/credential/show/objectformats_test.go index e151619df0d..1865538e1a6 100644 --- a/pkg/cli/cmd/credential/show/objectformats_test.go +++ b/pkg/cli/cmd/credential/show/objectformats_test.go @@ -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", @@ -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", @@ -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()) }