Skip to content

Commit

Permalink
fixed piping through jq functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Linh Nguyen committed Jun 24, 2021
1 parent 1a90f0d commit 63d5052
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/account/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (o *cliOptions) complete(cmd *cobra.Command) error {
func (o *cliOptions) run() error {
awsClient, err := o.k8sclusterresourcefactory.GetCloudProvider(o.verbose)
if err != nil {

return err
}

Expand All @@ -98,7 +99,12 @@ func (o *cliOptions) run() error {
}

if o.output == "json" {
fmt.Fprintf(o.IOStreams.Out, "%s\n", creds)
fmt.Fprintf(o.IOStreams.Out, "{\n\"AccessKeyId\": %q, \n\"Expiration\": %q, \n\"SecretAccessKey\": %q, \n\"SessionToken\": %q\n}",
*creds.AccessKeyId,
*creds.Expiration,
*creds.SecretAccessKey,
*creds.SessionToken,
)
}

if o.output == "env" {
Expand Down

0 comments on commit 63d5052

Please sign in to comment.