From e3be2469079bdfefb0af27ee4d4879f953911656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Go=CC=88kc=CC=A7e=20Go=CC=88k=20Klingel?= Date: Thu, 16 May 2024 13:26:22 +0200 Subject: [PATCH] change marshal function to add indentation --- internal/cmd/argus/credentials/list/list.go | 2 +- internal/cmd/argus/grafana/describe/describe.go | 2 +- internal/cmd/argus/instance/create/create.go | 2 +- internal/cmd/argus/instance/describe/describe.go | 2 +- internal/cmd/argus/instance/list/list.go | 2 +- internal/cmd/argus/plans/plans.go | 2 +- internal/cmd/argus/scrape-config/describe/describe.go | 2 +- internal/cmd/argus/scrape-config/list/list.go | 2 +- internal/cmd/config/list/list.go | 2 +- internal/cmd/dns/record-set/create/create.go | 2 +- internal/cmd/dns/record-set/describe/describe.go | 2 +- internal/cmd/dns/record-set/list/list.go | 2 +- internal/cmd/dns/zone/create/create.go | 2 +- internal/cmd/dns/zone/describe/describe.go | 2 +- internal/cmd/dns/zone/list/list.go | 2 +- internal/cmd/load-balancer/describe/describe.go | 2 +- internal/cmd/load-balancer/list/list.go | 2 +- .../cmd/load-balancer/observability-credentials/add/add.go | 2 +- .../observability-credentials/describe/describe.go | 2 +- .../cmd/load-balancer/observability-credentials/list/list.go | 2 +- internal/cmd/load-balancer/quota/quota.go | 2 +- internal/cmd/load-balancer/target-pool/describe/describe.go | 2 +- internal/cmd/logme/credentials/create/create.go | 2 +- internal/cmd/logme/credentials/describe/describe.go | 2 +- internal/cmd/logme/credentials/list/list.go | 2 +- internal/cmd/logme/instance/create/create.go | 2 +- internal/cmd/logme/instance/describe/describe.go | 2 +- internal/cmd/logme/instance/list/list.go | 2 +- internal/cmd/logme/plans/plans.go | 2 +- internal/cmd/mariadb/credentials/create/create.go | 2 +- internal/cmd/mariadb/credentials/describe/describe.go | 2 +- internal/cmd/mariadb/credentials/list/list.go | 2 +- internal/cmd/mariadb/instance/create/create.go | 2 +- internal/cmd/mariadb/instance/describe/describe.go | 2 +- internal/cmd/mariadb/instance/list/list.go | 2 +- internal/cmd/mariadb/plans/plans.go | 2 +- internal/cmd/mongodbflex/backup/describe/describe.go | 2 +- internal/cmd/mongodbflex/backup/list/list.go | 2 +- internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go | 2 +- internal/cmd/mongodbflex/backup/schedule/schedule.go | 2 +- internal/cmd/mongodbflex/instance/create/create.go | 2 +- internal/cmd/mongodbflex/instance/describe/describe.go | 2 +- internal/cmd/mongodbflex/instance/list/list.go | 2 +- internal/cmd/mongodbflex/instance/update/update.go | 2 +- internal/cmd/mongodbflex/options/options.go | 2 +- internal/cmd/mongodbflex/user/create/create.go | 2 +- internal/cmd/mongodbflex/user/describe/describe.go | 2 +- internal/cmd/mongodbflex/user/list/list.go | 2 +- .../cmd/mongodbflex/user/reset-password/reset_password.go | 2 +- internal/cmd/object-storage/bucket/create/create.go | 2 +- internal/cmd/object-storage/bucket/describe/describe.go | 2 +- internal/cmd/object-storage/bucket/list/list.go | 2 +- .../cmd/object-storage/credentials-group/create/create.go | 2 +- internal/cmd/object-storage/credentials-group/list/list.go | 2 +- internal/cmd/object-storage/credentials/create/create.go | 2 +- internal/cmd/object-storage/credentials/list/list.go | 2 +- internal/cmd/opensearch/credentials/create/create.go | 2 +- internal/cmd/opensearch/credentials/describe/describe.go | 2 +- internal/cmd/opensearch/credentials/list/list.go | 2 +- internal/cmd/opensearch/instance/create/create.go | 2 +- internal/cmd/opensearch/instance/describe/describe.go | 2 +- internal/cmd/opensearch/instance/list/list.go | 2 +- internal/cmd/opensearch/plans/plans.go | 2 +- internal/cmd/organization/member/list/list.go | 2 +- internal/cmd/organization/role/list/list.go | 2 +- internal/cmd/postgresflex/backup/describe/describe.go | 2 +- internal/cmd/postgresflex/backup/list/list.go | 2 +- internal/cmd/postgresflex/instance/clone/clone.go | 2 +- internal/cmd/postgresflex/instance/create/create.go | 2 +- internal/cmd/postgresflex/instance/describe/describe.go | 2 +- internal/cmd/postgresflex/instance/list/list.go | 2 +- internal/cmd/postgresflex/instance/update/update.go | 2 +- internal/cmd/postgresflex/options/options.go | 2 +- internal/cmd/postgresflex/user/create/create.go | 2 +- internal/cmd/postgresflex/user/describe/describe.go | 2 +- internal/cmd/postgresflex/user/list/list.go | 2 +- .../cmd/postgresflex/user/reset-password/reset_password.go | 2 +- internal/cmd/project/create/create.go | 2 +- internal/cmd/project/describe/describe.go | 2 +- internal/cmd/project/list/list.go | 2 +- internal/cmd/project/member/list/list.go | 2 +- internal/cmd/project/role/list/list.go | 2 +- internal/cmd/rabbitmq/credentials/create/create.go | 2 +- internal/cmd/rabbitmq/credentials/describe/describe.go | 2 +- internal/cmd/rabbitmq/credentials/list/list.go | 2 +- internal/cmd/rabbitmq/instance/create/create.go | 2 +- internal/cmd/rabbitmq/instance/describe/describe.go | 2 +- internal/cmd/rabbitmq/instance/list/list.go | 2 +- internal/cmd/rabbitmq/plans/plans.go | 2 +- internal/cmd/redis/credentials/create/create.go | 2 +- internal/cmd/redis/credentials/describe/describe.go | 2 +- internal/cmd/redis/credentials/list/list.go | 2 +- internal/cmd/redis/instance/create/create.go | 2 +- internal/cmd/redis/instance/describe/describe.go | 2 +- internal/cmd/redis/instance/list/list.go | 2 +- internal/cmd/redis/plans/plans.go | 2 +- internal/cmd/secrets-manager/instance/create/create.go | 2 +- internal/cmd/secrets-manager/instance/describe/describe.go | 2 +- internal/cmd/secrets-manager/instance/list/list.go | 2 +- internal/cmd/secrets-manager/user/create/create.go | 2 +- internal/cmd/secrets-manager/user/describe/describe.go | 2 +- internal/cmd/secrets-manager/user/list/list.go | 2 +- internal/cmd/service-account/create/create.go | 2 +- internal/cmd/service-account/key/list/list.go | 2 +- internal/cmd/service-account/list/list.go | 2 +- internal/cmd/service-account/token/create/create.go | 2 +- internal/cmd/service-account/token/list/list.go | 2 +- internal/cmd/ske/cluster/create/create.go | 2 +- internal/cmd/ske/cluster/describe/describe.go | 2 +- internal/cmd/ske/cluster/list/list.go | 2 +- internal/cmd/ske/cluster/update/update.go | 2 +- internal/cmd/ske/credentials/describe/describe.go | 2 +- internal/cmd/ske/describe/describe.go | 2 +- internal/cmd/ske/kubeconfig/create/create.go | 4 ++-- internal/cmd/ske/options/options.go | 2 +- 115 files changed, 116 insertions(+), 116 deletions(-) diff --git a/internal/cmd/argus/credentials/list/list.go b/internal/cmd/argus/credentials/list/list.go index 299f8e499..795b4278e 100644 --- a/internal/cmd/argus/credentials/list/list.go +++ b/internal/cmd/argus/credentials/list/list.go @@ -134,7 +134,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []argus.Ser return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus credentials list: %w", err) } diff --git a/internal/cmd/argus/grafana/describe/describe.go b/internal/cmd/argus/grafana/describe/describe.go index b689f65f9..4c8f930b7 100644 --- a/internal/cmd/argus/grafana/describe/describe.go +++ b/internal/cmd/argus/grafana/describe/describe.go @@ -135,7 +135,7 @@ func outputResult(p *print.Printer, inputModel *inputModel, grafanaConfigs *argu return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(grafanaConfigs) + details, err := yaml.MarshalWithOptions(grafanaConfigs, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Grafana configs: %w", err) } diff --git a/internal/cmd/argus/instance/create/create.go b/internal/cmd/argus/instance/create/create.go index a6426fafd..b37396bb7 100644 --- a/internal/cmd/argus/instance/create/create.go +++ b/internal/cmd/argus/instance/create/create.go @@ -210,7 +210,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus instance: %w", err) } diff --git a/internal/cmd/argus/instance/describe/describe.go b/internal/cmd/argus/instance/describe/describe.go index 4297be6bc..c6e8bc197 100644 --- a/internal/cmd/argus/instance/describe/describe.go +++ b/internal/cmd/argus/instance/describe/describe.go @@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *argus.GetInst return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus instance: %w", err) } diff --git a/internal/cmd/argus/instance/list/list.go b/internal/cmd/argus/instance/list/list.go index cc2642b40..98a8e74d5 100644 --- a/internal/cmd/argus/instance/list/list.go +++ b/internal/cmd/argus/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []argus.Proje return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus instance list: %w", err) } diff --git a/internal/cmd/argus/plans/plans.go b/internal/cmd/argus/plans/plans.go index 8ebf57fdf..a80800177 100644 --- a/internal/cmd/argus/plans/plans.go +++ b/internal/cmd/argus/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []argus.Plan) err return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus plans: %w", err) } diff --git a/internal/cmd/argus/scrape-config/describe/describe.go b/internal/cmd/argus/scrape-config/describe/describe.go index 269c58307..2b9d1fb99 100644 --- a/internal/cmd/argus/scrape-config/describe/describe.go +++ b/internal/cmd/argus/scrape-config/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, config *argus.Job) erro return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(config) + details, err := yaml.MarshalWithOptions(config, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal scrape configuration: %w", err) } diff --git a/internal/cmd/argus/scrape-config/list/list.go b/internal/cmd/argus/scrape-config/list/list.go index 3ed92968c..60f6598a0 100644 --- a/internal/cmd/argus/scrape-config/list/list.go +++ b/internal/cmd/argus/scrape-config/list/list.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, outputFormat string, configs []argus.Job) er return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(configs) + details, err := yaml.MarshalWithOptions(configs, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal scrape configurations list: %w", err) } diff --git a/internal/cmd/config/list/list.go b/internal/cmd/config/list/list.go index dde7ff87d..560e1dd89 100644 --- a/internal/cmd/config/list/list.go +++ b/internal/cmd/config/list/list.go @@ -75,7 +75,7 @@ func outputResult(p *print.Printer, outputFormat string, configData map[string]a p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(configData) + details, err := yaml.MarshalWithOptions(configData, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal config list: %w", err) } diff --git a/internal/cmd/dns/record-set/create/create.go b/internal/cmd/dns/record-set/create/create.go index af74b704c..a6beefdc3 100644 --- a/internal/cmd/dns/record-set/create/create.go +++ b/internal/cmd/dns/record-set/create/create.go @@ -177,7 +177,7 @@ func outputResult(p *print.Printer, model *inputModel, zoneLabel string, resp *d return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS record-set: %w", err) } diff --git a/internal/cmd/dns/record-set/describe/describe.go b/internal/cmd/dns/record-set/describe/describe.go index 5f02a6d87..221729d91 100644 --- a/internal/cmd/dns/record-set/describe/describe.go +++ b/internal/cmd/dns/record-set/describe/describe.go @@ -124,7 +124,7 @@ func outputResult(p *print.Printer, outputFormat string, recordSet *dns.RecordSe return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(recordSet) + details, err := yaml.MarshalWithOptions(recordSet, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS record set: %w", err) } diff --git a/internal/cmd/dns/record-set/list/list.go b/internal/cmd/dns/record-set/list/list.go index 4cdf30f47..a3a842832 100644 --- a/internal/cmd/dns/record-set/list/list.go +++ b/internal/cmd/dns/record-set/list/list.go @@ -245,7 +245,7 @@ func outputResult(p *print.Printer, outputFormat string, recordSets []dns.Record return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(recordSets) + details, err := yaml.MarshalWithOptions(recordSets, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS record set list: %w", err) } diff --git a/internal/cmd/dns/zone/create/create.go b/internal/cmd/dns/zone/create/create.go index a9a88a7d9..95507e40d 100644 --- a/internal/cmd/dns/zone/create/create.go +++ b/internal/cmd/dns/zone/create/create.go @@ -206,7 +206,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS zone: %w", err) } diff --git a/internal/cmd/dns/zone/describe/describe.go b/internal/cmd/dns/zone/describe/describe.go index b56deddb3..578dee03c 100644 --- a/internal/cmd/dns/zone/describe/describe.go +++ b/internal/cmd/dns/zone/describe/describe.go @@ -109,7 +109,7 @@ func outputResult(p *print.Printer, outputFormat string, zone *dns.Zone) error { return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(zone) + details, err := yaml.MarshalWithOptions(zone, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS zone: %w", err) } diff --git a/internal/cmd/dns/zone/list/list.go b/internal/cmd/dns/zone/list/list.go index 583348705..49e23a0b0 100644 --- a/internal/cmd/dns/zone/list/list.go +++ b/internal/cmd/dns/zone/list/list.go @@ -234,7 +234,7 @@ func outputResult(p *print.Printer, outputFormat string, zones []dns.Zone) error return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(zones) + details, err := yaml.MarshalWithOptions(zones, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal DNS zone list: %w", err) } diff --git a/internal/cmd/load-balancer/describe/describe.go b/internal/cmd/load-balancer/describe/describe.go index 1d6de5ab2..d5cf4dec9 100644 --- a/internal/cmd/load-balancer/describe/describe.go +++ b/internal/cmd/load-balancer/describe/describe.go @@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancer *loadbalan return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(loadBalancer) + details, err := yaml.MarshalWithOptions(loadBalancer, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal load balancer: %w", err) } diff --git a/internal/cmd/load-balancer/list/list.go b/internal/cmd/load-balancer/list/list.go index 92727e8db..a82a0384d 100644 --- a/internal/cmd/load-balancer/list/list.go +++ b/internal/cmd/load-balancer/list/list.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancers []loadbal return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(loadBalancers) + details, err := yaml.MarshalWithOptions(loadBalancers, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal load balancer list: %w", err) } diff --git a/internal/cmd/load-balancer/observability-credentials/add/add.go b/internal/cmd/load-balancer/observability-credentials/add/add.go index 60253c7f2..b1213eefd 100644 --- a/internal/cmd/load-balancer/observability-credentials/add/add.go +++ b/internal/cmd/load-balancer/observability-credentials/add/add.go @@ -159,7 +159,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Load Balancer observability credentials: %w", err) } diff --git a/internal/cmd/load-balancer/observability-credentials/describe/describe.go b/internal/cmd/load-balancer/observability-credentials/describe/describe.go index e67822696..27d27caf8 100644 --- a/internal/cmd/load-balancer/observability-credentials/describe/describe.go +++ b/internal/cmd/load-balancer/observability-credentials/describe/describe.go @@ -105,7 +105,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *loadbalanc return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Load Balancer observability credentials: %w", err) } diff --git a/internal/cmd/load-balancer/observability-credentials/list/list.go b/internal/cmd/load-balancer/observability-credentials/list/list.go index 2158112ea..226d9f06a 100644 --- a/internal/cmd/load-balancer/observability-credentials/list/list.go +++ b/internal/cmd/load-balancer/observability-credentials/list/list.go @@ -177,7 +177,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []loadbalan return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Load Balancer observability credentials list: %w", err) } diff --git a/internal/cmd/load-balancer/quota/quota.go b/internal/cmd/load-balancer/quota/quota.go index f2c95335b..593e117b7 100644 --- a/internal/cmd/load-balancer/quota/quota.go +++ b/internal/cmd/load-balancer/quota/quota.go @@ -98,7 +98,7 @@ func outputResult(p *print.Printer, outputFormat string, quota *loadbalancer.Get return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(quota) + details, err := yaml.MarshalWithOptions(quota, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal quota: %w", err) } diff --git a/internal/cmd/load-balancer/target-pool/describe/describe.go b/internal/cmd/load-balancer/target-pool/describe/describe.go index b4a2da47d..e3e5921fc 100644 --- a/internal/cmd/load-balancer/target-pool/describe/describe.go +++ b/internal/cmd/load-balancer/target-pool/describe/describe.go @@ -138,7 +138,7 @@ func outputResult(p *print.Printer, outputFormat string, targetPool loadbalancer return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(output) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal load balancer: %w", err) } diff --git a/internal/cmd/logme/credentials/create/create.go b/internal/cmd/logme/credentials/create/create.go index 53181d329..76b3b14f1 100644 --- a/internal/cmd/logme/credentials/create/create.go +++ b/internal/cmd/logme/credentials/create/create.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe credentials: %w", err) } diff --git a/internal/cmd/logme/credentials/describe/describe.go b/internal/cmd/logme/credentials/describe/describe.go index 384370ca9..e2b7551a9 100644 --- a/internal/cmd/logme/credentials/describe/describe.go +++ b/internal/cmd/logme/credentials/describe/describe.go @@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *logme.Cred return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe credentials: %w", err) } diff --git a/internal/cmd/logme/credentials/list/list.go b/internal/cmd/logme/credentials/list/list.go index 87a87f06f..653902d56 100644 --- a/internal/cmd/logme/credentials/list/list.go +++ b/internal/cmd/logme/credentials/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []logme.Cre return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe credentials list: %w", err) } diff --git a/internal/cmd/logme/instance/create/create.go b/internal/cmd/logme/instance/create/create.go index 7db6945ca..7e2b15e2f 100644 --- a/internal/cmd/logme/instance/create/create.go +++ b/internal/cmd/logme/instance/create/create.go @@ -262,7 +262,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe instance: %w", err) } diff --git a/internal/cmd/logme/instance/describe/describe.go b/internal/cmd/logme/instance/describe/describe.go index ee258cda5..9e477f16a 100644 --- a/internal/cmd/logme/instance/describe/describe.go +++ b/internal/cmd/logme/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *logme.Instanc return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe instance: %w", err) } diff --git a/internal/cmd/logme/instance/list/list.go b/internal/cmd/logme/instance/list/list.go index 278f2ecb5..24e3cf999 100644 --- a/internal/cmd/logme/instance/list/list.go +++ b/internal/cmd/logme/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []logme.Insta return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe instance list: %w", err) } diff --git a/internal/cmd/logme/plans/plans.go b/internal/cmd/logme/plans/plans.go index e9424caab..dfa14ed0e 100644 --- a/internal/cmd/logme/plans/plans.go +++ b/internal/cmd/logme/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []logme.Offering) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal LogMe plans: %w", err) } diff --git a/internal/cmd/mariadb/credentials/create/create.go b/internal/cmd/mariadb/credentials/create/create.go index 153bff36e..4373782ea 100644 --- a/internal/cmd/mariadb/credentials/create/create.go +++ b/internal/cmd/mariadb/credentials/create/create.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Argus credentials list: %w", err) } diff --git a/internal/cmd/mariadb/credentials/describe/describe.go b/internal/cmd/mariadb/credentials/describe/describe.go index 2a9af74c4..ae5eeece0 100644 --- a/internal/cmd/mariadb/credentials/describe/describe.go +++ b/internal/cmd/mariadb/credentials/describe/describe.go @@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *mariadb.Cr return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB credentials: %w", err) } diff --git a/internal/cmd/mariadb/credentials/list/list.go b/internal/cmd/mariadb/credentials/list/list.go index 338f815c2..75a438804 100644 --- a/internal/cmd/mariadb/credentials/list/list.go +++ b/internal/cmd/mariadb/credentials/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []mariadb.C return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB credentials list: %w", err) } diff --git a/internal/cmd/mariadb/instance/create/create.go b/internal/cmd/mariadb/instance/create/create.go index 33ee39456..754b50fcd 100644 --- a/internal/cmd/mariadb/instance/create/create.go +++ b/internal/cmd/mariadb/instance/create/create.go @@ -262,7 +262,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB instance: %w", err) } diff --git a/internal/cmd/mariadb/instance/describe/describe.go b/internal/cmd/mariadb/instance/describe/describe.go index 8b5157642..94323bc5e 100644 --- a/internal/cmd/mariadb/instance/describe/describe.go +++ b/internal/cmd/mariadb/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mariadb.Insta return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB instance: %w", err) } diff --git a/internal/cmd/mariadb/instance/list/list.go b/internal/cmd/mariadb/instance/list/list.go index b940ac9ef..4a3b31672 100644 --- a/internal/cmd/mariadb/instance/list/list.go +++ b/internal/cmd/mariadb/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []mariadb.Ins return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB instance list: %w", err) } diff --git a/internal/cmd/mariadb/plans/plans.go b/internal/cmd/mariadb/plans/plans.go index 719a60913..4fb14c3c2 100644 --- a/internal/cmd/mariadb/plans/plans.go +++ b/internal/cmd/mariadb/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []mariadb.Offerin return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MariaDB plans: %w", err) } diff --git a/internal/cmd/mongodbflex/backup/describe/describe.go b/internal/cmd/mongodbflex/backup/describe/describe.go index 7baa58b2a..6488c6ee7 100644 --- a/internal/cmd/mongodbflex/backup/describe/describe.go +++ b/internal/cmd/mongodbflex/backup/describe/describe.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat, restoreSta return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(backup) + details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex backup: %w", err) } diff --git a/internal/cmd/mongodbflex/backup/list/list.go b/internal/cmd/mongodbflex/backup/list/list.go index 7dcba1bf2..f1a26ce75 100644 --- a/internal/cmd/mongodbflex/backup/list/list.go +++ b/internal/cmd/mongodbflex/backup/list/list.go @@ -155,7 +155,7 @@ func outputResult(p *print.Printer, outputFormat string, backups []mongodbflex.B return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(backups) + details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex backups list: %w", err) } diff --git a/internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go b/internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go index c9601df96..5d5d0cad8 100644 --- a/internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go +++ b/internal/cmd/mongodbflex/backup/restore-jobs/restore_jobs.go @@ -149,7 +149,7 @@ func outputResult(p *print.Printer, outputFormat string, restoreJobs []mongodbfl return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(restoreJobs) + details, err := yaml.MarshalWithOptions(restoreJobs, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex restore jobs list: %w", err) } diff --git a/internal/cmd/mongodbflex/backup/schedule/schedule.go b/internal/cmd/mongodbflex/backup/schedule/schedule.go index 58e120c81..ffd84ca3e 100644 --- a/internal/cmd/mongodbflex/backup/schedule/schedule.go +++ b/internal/cmd/mongodbflex/backup/schedule/schedule.go @@ -130,7 +130,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mongodbflex.I return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(output) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex backup schedule: %w", err) } diff --git a/internal/cmd/mongodbflex/instance/create/create.go b/internal/cmd/mongodbflex/instance/create/create.go index 68e0f4598..607774a0c 100644 --- a/internal/cmd/mongodbflex/instance/create/create.go +++ b/internal/cmd/mongodbflex/instance/create/create.go @@ -284,7 +284,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDBFlex instance: %w", err) } diff --git a/internal/cmd/mongodbflex/instance/describe/describe.go b/internal/cmd/mongodbflex/instance/describe/describe.go index 5616cc2ec..1d1bacb99 100644 --- a/internal/cmd/mongodbflex/instance/describe/describe.go +++ b/internal/cmd/mongodbflex/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *mongodbflex.I return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex instance: %w", err) } diff --git a/internal/cmd/mongodbflex/instance/list/list.go b/internal/cmd/mongodbflex/instance/list/list.go index a9cffa923..443c7ef08 100644 --- a/internal/cmd/mongodbflex/instance/list/list.go +++ b/internal/cmd/mongodbflex/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []mongodbflex return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex instance list: %w", err) } diff --git a/internal/cmd/mongodbflex/instance/update/update.go b/internal/cmd/mongodbflex/instance/update/update.go index 31758799b..bc3dba632 100644 --- a/internal/cmd/mongodbflex/instance/update/update.go +++ b/internal/cmd/mongodbflex/instance/update/update.go @@ -318,7 +318,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal update MongoDBFlex instance: %w", err) } diff --git a/internal/cmd/mongodbflex/options/options.go b/internal/cmd/mongodbflex/options/options.go index 0e6b571f3..2480e5b10 100644 --- a/internal/cmd/mongodbflex/options/options.go +++ b/internal/cmd/mongodbflex/options/options.go @@ -193,7 +193,7 @@ func outputResult(p *print.Printer, model *inputModel, flavors *mongodbflex.List p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(options) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex options: %w", err) } diff --git a/internal/cmd/mongodbflex/user/create/create.go b/internal/cmd/mongodbflex/user/create/create.go index 1a985da5a..8e8b743c5 100644 --- a/internal/cmd/mongodbflex/user/create/create.go +++ b/internal/cmd/mongodbflex/user/create/create.go @@ -159,7 +159,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, use return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex user: %w", err) } diff --git a/internal/cmd/mongodbflex/user/describe/describe.go b/internal/cmd/mongodbflex/user/describe/describe.go index 7c4ea1106..55d0e4f02 100644 --- a/internal/cmd/mongodbflex/user/describe/describe.go +++ b/internal/cmd/mongodbflex/user/describe/describe.go @@ -128,7 +128,7 @@ func outputResult(p *print.Printer, outputFormat string, user mongodbflex.Instan return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex user: %w", err) } diff --git a/internal/cmd/mongodbflex/user/list/list.go b/internal/cmd/mongodbflex/user/list/list.go index cfb35989f..ada4d0f6f 100644 --- a/internal/cmd/mongodbflex/user/list/list.go +++ b/internal/cmd/mongodbflex/user/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat string, users []mongodbflex.Lis return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(users) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex user list: %w", err) } diff --git a/internal/cmd/mongodbflex/user/reset-password/reset_password.go b/internal/cmd/mongodbflex/user/reset-password/reset_password.go index 12f194b5d..665ad9b8b 100644 --- a/internal/cmd/mongodbflex/user/reset-password/reset_password.go +++ b/internal/cmd/mongodbflex/user/reset-password/reset_password.go @@ -144,7 +144,7 @@ func outputResult(p *print.Printer, model *inputModel, userLabel, instanceLabel return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal MongoDB Flex reset password: %w", err) } diff --git a/internal/cmd/object-storage/bucket/create/create.go b/internal/cmd/object-storage/bucket/create/create.go index d719ee97f..5d145819b 100644 --- a/internal/cmd/object-storage/bucket/create/create.go +++ b/internal/cmd/object-storage/bucket/create/create.go @@ -125,7 +125,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *objectstorage.Creat return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage bucket: %w", err) } diff --git a/internal/cmd/object-storage/bucket/describe/describe.go b/internal/cmd/object-storage/bucket/describe/describe.go index 9b9a529b1..4196de7bc 100644 --- a/internal/cmd/object-storage/bucket/describe/describe.go +++ b/internal/cmd/object-storage/bucket/describe/describe.go @@ -107,7 +107,7 @@ func outputResult(p *print.Printer, outputFormat string, bucket *objectstorage.B return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(bucket) + details, err := yaml.MarshalWithOptions(bucket, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage bucket: %w", err) } diff --git a/internal/cmd/object-storage/bucket/list/list.go b/internal/cmd/object-storage/bucket/list/list.go index 771016e21..13367f035 100644 --- a/internal/cmd/object-storage/bucket/list/list.go +++ b/internal/cmd/object-storage/bucket/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, buckets []objectstorage return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(buckets) + details, err := yaml.MarshalWithOptions(buckets, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage bucket list: %w", err) } diff --git a/internal/cmd/object-storage/credentials-group/create/create.go b/internal/cmd/object-storage/credentials-group/create/create.go index 370b4350d..d7399e501 100644 --- a/internal/cmd/object-storage/credentials-group/create/create.go +++ b/internal/cmd/object-storage/credentials-group/create/create.go @@ -123,7 +123,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *objectstorage.Creat return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage credentials group: %w", err) } diff --git a/internal/cmd/object-storage/credentials-group/list/list.go b/internal/cmd/object-storage/credentials-group/list/list.go index c3b90e38e..073a88a9a 100644 --- a/internal/cmd/object-storage/credentials-group/list/list.go +++ b/internal/cmd/object-storage/credentials-group/list/list.go @@ -132,7 +132,7 @@ func outputResult(p *print.Printer, outputFormat string, credentialsGroups []obj return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentialsGroups) + details, err := yaml.MarshalWithOptions(credentialsGroups, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage credentials group list: %w", err) } diff --git a/internal/cmd/object-storage/credentials/create/create.go b/internal/cmd/object-storage/credentials/create/create.go index f92004b94..2d9387cc3 100644 --- a/internal/cmd/object-storage/credentials/create/create.go +++ b/internal/cmd/object-storage/credentials/create/create.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, model *inputModel, credentialsGroupLabel str return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage credentials: %w", err) } diff --git a/internal/cmd/object-storage/credentials/list/list.go b/internal/cmd/object-storage/credentials/list/list.go index c7c8d5299..3814a0464 100644 --- a/internal/cmd/object-storage/credentials/list/list.go +++ b/internal/cmd/object-storage/credentials/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []objectsto return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Object Storage credentials list: %w", err) } diff --git a/internal/cmd/opensearch/credentials/create/create.go b/internal/cmd/opensearch/credentials/create/create.go index 636488d4c..eebf71bb8 100644 --- a/internal/cmd/opensearch/credentials/create/create.go +++ b/internal/cmd/opensearch/credentials/create/create.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch credentials: %w", err) } diff --git a/internal/cmd/opensearch/credentials/describe/describe.go b/internal/cmd/opensearch/credentials/describe/describe.go index 0e1c7547f..596ffc3eb 100644 --- a/internal/cmd/opensearch/credentials/describe/describe.go +++ b/internal/cmd/opensearch/credentials/describe/describe.go @@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *opensearch return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch credentials: %w", err) } diff --git a/internal/cmd/opensearch/credentials/list/list.go b/internal/cmd/opensearch/credentials/list/list.go index 9c76251f9..e4baea08d 100644 --- a/internal/cmd/opensearch/credentials/list/list.go +++ b/internal/cmd/opensearch/credentials/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []opensearc return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch credentials list: %w", err) } diff --git a/internal/cmd/opensearch/instance/create/create.go b/internal/cmd/opensearch/instance/create/create.go index 7e9038a2e..0433ce412 100644 --- a/internal/cmd/opensearch/instance/create/create.go +++ b/internal/cmd/opensearch/instance/create/create.go @@ -267,7 +267,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch instance: %w", err) } diff --git a/internal/cmd/opensearch/instance/describe/describe.go b/internal/cmd/opensearch/instance/describe/describe.go index 27cdbfe98..b1f06faff 100644 --- a/internal/cmd/opensearch/instance/describe/describe.go +++ b/internal/cmd/opensearch/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *opensearch.In return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch instance: %w", err) } diff --git a/internal/cmd/opensearch/instance/list/list.go b/internal/cmd/opensearch/instance/list/list.go index 59c6e0115..a08b7ed1c 100644 --- a/internal/cmd/opensearch/instance/list/list.go +++ b/internal/cmd/opensearch/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []opensearch. return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch instance list: %w", err) } diff --git a/internal/cmd/opensearch/plans/plans.go b/internal/cmd/opensearch/plans/plans.go index 7aef92cab..6f8a4ab74 100644 --- a/internal/cmd/opensearch/plans/plans.go +++ b/internal/cmd/opensearch/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []opensearch.Offe return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal OpenSearch plans: %w", err) } diff --git a/internal/cmd/organization/member/list/list.go b/internal/cmd/organization/member/list/list.go index 995bdc061..8b68411cd 100644 --- a/internal/cmd/organization/member/list/list.go +++ b/internal/cmd/organization/member/list/list.go @@ -167,7 +167,7 @@ func outputResult(p *print.Printer, model *inputModel, members []authorization.M return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(members) + details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal members: %w", err) } diff --git a/internal/cmd/organization/role/list/list.go b/internal/cmd/organization/role/list/list.go index c07ecd4eb..68352bff1 100644 --- a/internal/cmd/organization/role/list/list.go +++ b/internal/cmd/organization/role/list/list.go @@ -140,7 +140,7 @@ func outputRolesResult(p *print.Printer, outputFormat string, roles []authorizat return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(roles) + details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal roles: %w", err) } diff --git a/internal/cmd/postgresflex/backup/describe/describe.go b/internal/cmd/postgresflex/backup/describe/describe.go index 580817c56..9e306e2b4 100644 --- a/internal/cmd/postgresflex/backup/describe/describe.go +++ b/internal/cmd/postgresflex/backup/describe/describe.go @@ -124,7 +124,7 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat string, bac return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(backup) + details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal backup for PostgreSQL Flex backup: %w", err) } diff --git a/internal/cmd/postgresflex/backup/list/list.go b/internal/cmd/postgresflex/backup/list/list.go index 4dfea3f48..0ed9a5155 100644 --- a/internal/cmd/postgresflex/backup/list/list.go +++ b/internal/cmd/postgresflex/backup/list/list.go @@ -144,7 +144,7 @@ func outputResult(p *print.Printer, outputFormat string, backups []postgresflex. return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(backups) + details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex backup list: %w", err) } diff --git a/internal/cmd/postgresflex/instance/clone/clone.go b/internal/cmd/postgresflex/instance/clone/clone.go index 8ef0778be..b9d10e78b 100644 --- a/internal/cmd/postgresflex/instance/clone/clone.go +++ b/internal/cmd/postgresflex/instance/clone/clone.go @@ -216,7 +216,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgresFlex instance clone: %w", err) } diff --git a/internal/cmd/postgresflex/instance/create/create.go b/internal/cmd/postgresflex/instance/create/create.go index 9c33194f7..ed7cec878 100644 --- a/internal/cmd/postgresflex/instance/create/create.go +++ b/internal/cmd/postgresflex/instance/create/create.go @@ -284,7 +284,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgresFlex instance: %w", err) } diff --git a/internal/cmd/postgresflex/instance/describe/describe.go b/internal/cmd/postgresflex/instance/describe/describe.go index bcea75095..b47dbc025 100644 --- a/internal/cmd/postgresflex/instance/describe/describe.go +++ b/internal/cmd/postgresflex/instance/describe/describe.go @@ -112,7 +112,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *postgresflex. return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex instance: %w", err) } diff --git a/internal/cmd/postgresflex/instance/list/list.go b/internal/cmd/postgresflex/instance/list/list.go index 4215fab5e..3759061ea 100644 --- a/internal/cmd/postgresflex/instance/list/list.go +++ b/internal/cmd/postgresflex/instance/list/list.go @@ -142,7 +142,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []postgresfle return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex instance list: %w", err) } diff --git a/internal/cmd/postgresflex/instance/update/update.go b/internal/cmd/postgresflex/instance/update/update.go index 2b79cad99..975c7c860 100644 --- a/internal/cmd/postgresflex/instance/update/update.go +++ b/internal/cmd/postgresflex/instance/update/update.go @@ -318,7 +318,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgresFlex instance: %w", err) } diff --git a/internal/cmd/postgresflex/options/options.go b/internal/cmd/postgresflex/options/options.go index 2280af786..ba94aea08 100644 --- a/internal/cmd/postgresflex/options/options.go +++ b/internal/cmd/postgresflex/options/options.go @@ -193,7 +193,7 @@ func outputResult(p *print.Printer, model *inputModel, flavors *postgresflex.Lis p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(options) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex options: %w", err) } diff --git a/internal/cmd/postgresflex/user/create/create.go b/internal/cmd/postgresflex/user/create/create.go index 5cd2e94b1..6a0d1f103 100644 --- a/internal/cmd/postgresflex/user/create/create.go +++ b/internal/cmd/postgresflex/user/create/create.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgresFlex user: %w", err) } diff --git a/internal/cmd/postgresflex/user/describe/describe.go b/internal/cmd/postgresflex/user/describe/describe.go index e68f8fdd6..8f177aa18 100644 --- a/internal/cmd/postgresflex/user/describe/describe.go +++ b/internal/cmd/postgresflex/user/describe/describe.go @@ -127,7 +127,7 @@ func outputResult(p *print.Printer, outputFormat string, user postgresflex.UserR return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex user: %w", err) } diff --git a/internal/cmd/postgresflex/user/list/list.go b/internal/cmd/postgresflex/user/list/list.go index d27e74a16..62e354334 100644 --- a/internal/cmd/postgresflex/user/list/list.go +++ b/internal/cmd/postgresflex/user/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat string, users []postgresflex.Li return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(users) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex user list: %w", err) } diff --git a/internal/cmd/postgresflex/user/reset-password/reset_password.go b/internal/cmd/postgresflex/user/reset-password/reset_password.go index 79e91b050..77c881189 100644 --- a/internal/cmd/postgresflex/user/reset-password/reset_password.go +++ b/internal/cmd/postgresflex/user/reset-password/reset_password.go @@ -143,7 +143,7 @@ func outputResult(p *print.Printer, model *inputModel, userLabel, instanceLabel return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal PostgresFlex user: %w", err) } diff --git a/internal/cmd/project/create/create.go b/internal/cmd/project/create/create.go index 3e7502eb6..59b478584 100644 --- a/internal/cmd/project/create/create.go +++ b/internal/cmd/project/create/create.go @@ -200,7 +200,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *resourcemanager.Pro return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal project: %w", err) } diff --git a/internal/cmd/project/describe/describe.go b/internal/cmd/project/describe/describe.go index 8d97a0354..9047fec7a 100644 --- a/internal/cmd/project/describe/describe.go +++ b/internal/cmd/project/describe/describe.go @@ -129,7 +129,7 @@ func outputResult(p *print.Printer, outputFormat string, project *resourcemanage return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(project) + details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal project details: %w", err) } diff --git a/internal/cmd/project/list/list.go b/internal/cmd/project/list/list.go index dfcff75a5..73b5bdd9a 100644 --- a/internal/cmd/project/list/list.go +++ b/internal/cmd/project/list/list.go @@ -230,7 +230,7 @@ func outputResult(p *print.Printer, outputFormat string, projects []resourcemana return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(projects) + details, err := yaml.MarshalWithOptions(projects, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal projects list: %w", err) } diff --git a/internal/cmd/project/member/list/list.go b/internal/cmd/project/member/list/list.go index ea0078c12..6171a0b4e 100644 --- a/internal/cmd/project/member/list/list.go +++ b/internal/cmd/project/member/list/list.go @@ -169,7 +169,7 @@ func outputResult(p *print.Printer, model *inputModel, members []authorization.M return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(members) + details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal members: %w", err) } diff --git a/internal/cmd/project/role/list/list.go b/internal/cmd/project/role/list/list.go index 6ac1b3886..b00c10b4a 100644 --- a/internal/cmd/project/role/list/list.go +++ b/internal/cmd/project/role/list/list.go @@ -142,7 +142,7 @@ func outputRolesResult(p *print.Printer, outputFormat string, roles []authorizat return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(roles) + details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal roles: %w", err) } diff --git a/internal/cmd/rabbitmq/credentials/create/create.go b/internal/cmd/rabbitmq/credentials/create/create.go index eb1f8cab2..bed0dafd2 100644 --- a/internal/cmd/rabbitmq/credentials/create/create.go +++ b/internal/cmd/rabbitmq/credentials/create/create.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ credentials: %w", err) } diff --git a/internal/cmd/rabbitmq/credentials/describe/describe.go b/internal/cmd/rabbitmq/credentials/describe/describe.go index b57b7b383..175488d16 100644 --- a/internal/cmd/rabbitmq/credentials/describe/describe.go +++ b/internal/cmd/rabbitmq/credentials/describe/describe.go @@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *rabbitmq.C return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ credentials: %w", err) } diff --git a/internal/cmd/rabbitmq/credentials/list/list.go b/internal/cmd/rabbitmq/credentials/list/list.go index d37c12326..54140ec86 100644 --- a/internal/cmd/rabbitmq/credentials/list/list.go +++ b/internal/cmd/rabbitmq/credentials/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []rabbitmq. return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ credentials list: %w", err) } diff --git a/internal/cmd/rabbitmq/instance/create/create.go b/internal/cmd/rabbitmq/instance/create/create.go index 9ef818250..464f587b8 100644 --- a/internal/cmd/rabbitmq/instance/create/create.go +++ b/internal/cmd/rabbitmq/instance/create/create.go @@ -267,7 +267,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ instance: %w", err) } diff --git a/internal/cmd/rabbitmq/instance/describe/describe.go b/internal/cmd/rabbitmq/instance/describe/describe.go index d5cbd62e4..4aeb8fdf8 100644 --- a/internal/cmd/rabbitmq/instance/describe/describe.go +++ b/internal/cmd/rabbitmq/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *rabbitmq.Inst return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ instance: %w", err) } diff --git a/internal/cmd/rabbitmq/instance/list/list.go b/internal/cmd/rabbitmq/instance/list/list.go index 019569d68..b09ebd083 100644 --- a/internal/cmd/rabbitmq/instance/list/list.go +++ b/internal/cmd/rabbitmq/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []rabbitmq.In return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ instance list: %w", err) } diff --git a/internal/cmd/rabbitmq/plans/plans.go b/internal/cmd/rabbitmq/plans/plans.go index ad5d9eadd..ad19ecf18 100644 --- a/internal/cmd/rabbitmq/plans/plans.go +++ b/internal/cmd/rabbitmq/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []rabbitmq.Offeri return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal RabbitMQ plans: %w", err) } diff --git a/internal/cmd/redis/credentials/create/create.go b/internal/cmd/redis/credentials/create/create.go index 0f326d93f..7906c2885 100644 --- a/internal/cmd/redis/credentials/create/create.go +++ b/internal/cmd/redis/credentials/create/create.go @@ -138,7 +138,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis credentials: %w", err) } diff --git a/internal/cmd/redis/credentials/describe/describe.go b/internal/cmd/redis/credentials/describe/describe.go index e1bdb5277..48ec11a7c 100644 --- a/internal/cmd/redis/credentials/describe/describe.go +++ b/internal/cmd/redis/credentials/describe/describe.go @@ -122,7 +122,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *redis.Cred return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis credentials: %w", err) } diff --git a/internal/cmd/redis/credentials/list/list.go b/internal/cmd/redis/credentials/list/list.go index 27bf28fc4..b701a03d8 100644 --- a/internal/cmd/redis/credentials/list/list.go +++ b/internal/cmd/redis/credentials/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []redis.Cre return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis credentials list: %w", err) } diff --git a/internal/cmd/redis/instance/create/create.go b/internal/cmd/redis/instance/create/create.go index 6f60651f3..cd71a84a4 100644 --- a/internal/cmd/redis/instance/create/create.go +++ b/internal/cmd/redis/instance/create/create.go @@ -262,7 +262,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis instance: %w", err) } diff --git a/internal/cmd/redis/instance/describe/describe.go b/internal/cmd/redis/instance/describe/describe.go index 41b5c6552..b89ac51f1 100644 --- a/internal/cmd/redis/instance/describe/describe.go +++ b/internal/cmd/redis/instance/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *redis.Instanc return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instance) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis instance: %w", err) } diff --git a/internal/cmd/redis/instance/list/list.go b/internal/cmd/redis/instance/list/list.go index 5a9037065..969b20058 100644 --- a/internal/cmd/redis/instance/list/list.go +++ b/internal/cmd/redis/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []redis.Insta return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis instance list: %w", err) } diff --git a/internal/cmd/redis/plans/plans.go b/internal/cmd/redis/plans/plans.go index d4871479e..292857121 100644 --- a/internal/cmd/redis/plans/plans.go +++ b/internal/cmd/redis/plans/plans.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []redis.Offering) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(plans) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Redis plans: %w", err) } diff --git a/internal/cmd/secrets-manager/instance/create/create.go b/internal/cmd/secrets-manager/instance/create/create.go index 18c8b71d5..c95cb365f 100644 --- a/internal/cmd/secrets-manager/instance/create/create.go +++ b/internal/cmd/secrets-manager/instance/create/create.go @@ -168,7 +168,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager instance: %w", err) } diff --git a/internal/cmd/secrets-manager/instance/describe/describe.go b/internal/cmd/secrets-manager/instance/describe/describe.go index 7fbcfd054..d3f6e56b9 100644 --- a/internal/cmd/secrets-manager/instance/describe/describe.go +++ b/internal/cmd/secrets-manager/instance/describe/describe.go @@ -126,7 +126,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *secretsmanage return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(output) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager instance: %w", err) } diff --git a/internal/cmd/secrets-manager/instance/list/list.go b/internal/cmd/secrets-manager/instance/list/list.go index 5d9c3742f..9aa3a6a33 100644 --- a/internal/cmd/secrets-manager/instance/list/list.go +++ b/internal/cmd/secrets-manager/instance/list/list.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []secretsmana return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(instances) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager instance list: %w", err) } diff --git a/internal/cmd/secrets-manager/user/create/create.go b/internal/cmd/secrets-manager/user/create/create.go index c96514884..ac919e456 100644 --- a/internal/cmd/secrets-manager/user/create/create.go +++ b/internal/cmd/secrets-manager/user/create/create.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager user: %w", err) } diff --git a/internal/cmd/secrets-manager/user/describe/describe.go b/internal/cmd/secrets-manager/user/describe/describe.go index 1cd3f8449..35b8f927f 100644 --- a/internal/cmd/secrets-manager/user/describe/describe.go +++ b/internal/cmd/secrets-manager/user/describe/describe.go @@ -124,7 +124,7 @@ func outputResult(p *print.Printer, outputFormat string, user secretsmanager.Use return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(user) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager user: %w", err) } diff --git a/internal/cmd/secrets-manager/user/list/list.go b/internal/cmd/secrets-manager/user/list/list.go index 0963ac452..cfc9b1a87 100644 --- a/internal/cmd/secrets-manager/user/list/list.go +++ b/internal/cmd/secrets-manager/user/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat string, users []secretsmanager. return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(users) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal Secrets Manager user list: %w", err) } diff --git a/internal/cmd/service-account/create/create.go b/internal/cmd/service-account/create/create.go index b90e31c3b..5314543b8 100644 --- a/internal/cmd/service-account/create/create.go +++ b/internal/cmd/service-account/create/create.go @@ -129,7 +129,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, serv return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(serviceAccount) + details, err := yaml.MarshalWithOptions(serviceAccount, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal service account: %w", err) } diff --git a/internal/cmd/service-account/key/list/list.go b/internal/cmd/service-account/key/list/list.go index e92a93b4e..6c3c29da5 100644 --- a/internal/cmd/service-account/key/list/list.go +++ b/internal/cmd/service-account/key/list/list.go @@ -150,7 +150,7 @@ func outputResult(p *print.Printer, outputFormat string, keys []serviceaccount.S return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(keys) + details, err := yaml.MarshalWithOptions(keys, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal keys metadata: %w", err) } diff --git a/internal/cmd/service-account/list/list.go b/internal/cmd/service-account/list/list.go index 8e761bced..7fc9ffbff 100644 --- a/internal/cmd/service-account/list/list.go +++ b/internal/cmd/service-account/list/list.go @@ -132,7 +132,7 @@ func outputResult(p *print.Printer, outputFormat string, serviceAccounts []servi } p.Outputln(string(details)) case print.YAMLOutputFormat: - details, err := yaml.Marshal(serviceAccounts) + details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal service accounts list: %w", err) } diff --git a/internal/cmd/service-account/token/create/create.go b/internal/cmd/service-account/token/create/create.go index 14fc33845..fdaf09b01 100644 --- a/internal/cmd/service-account/token/create/create.go +++ b/internal/cmd/service-account/token/create/create.go @@ -153,7 +153,7 @@ func outputResult(p *print.Printer, model *inputModel, token *serviceaccount.Acc return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(token) + details, err := yaml.MarshalWithOptions(token, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal service account access token: %w", err) } diff --git a/internal/cmd/service-account/token/list/list.go b/internal/cmd/service-account/token/list/list.go index 30a3431c2..fc345d8cc 100644 --- a/internal/cmd/service-account/token/list/list.go +++ b/internal/cmd/service-account/token/list/list.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, outputFormat string, tokensMetadata []servic return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(tokensMetadata) + details, err := yaml.MarshalWithOptions(tokensMetadata, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal tokens metadata: %w", err) } diff --git a/internal/cmd/ske/cluster/create/create.go b/internal/cmd/ske/cluster/create/create.go index 45d5f1b56..4a9324f3d 100644 --- a/internal/cmd/ske/cluster/create/create.go +++ b/internal/cmd/ske/cluster/create/create.go @@ -198,7 +198,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE cluster: %w", err) } diff --git a/internal/cmd/ske/cluster/describe/describe.go b/internal/cmd/ske/cluster/describe/describe.go index 2af96a925..75a432bdb 100644 --- a/internal/cmd/ske/cluster/describe/describe.go +++ b/internal/cmd/ske/cluster/describe/describe.go @@ -107,7 +107,7 @@ func outputResult(p *print.Printer, outputFormat string, cluster *ske.Cluster) e return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(cluster) + details, err := yaml.MarshalWithOptions(cluster, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE cluster: %w", err) } diff --git a/internal/cmd/ske/cluster/list/list.go b/internal/cmd/ske/cluster/list/list.go index fc9a0a6c1..d0ee6da45 100644 --- a/internal/cmd/ske/cluster/list/list.go +++ b/internal/cmd/ske/cluster/list/list.go @@ -150,7 +150,7 @@ func outputResult(p *print.Printer, outputFormat string, clusters []ske.Cluster) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(clusters) + details, err := yaml.MarshalWithOptions(clusters, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE cluster list: %w", err) } diff --git a/internal/cmd/ske/cluster/update/update.go b/internal/cmd/ske/cluster/update/update.go index e499d3b6f..491daf86e 100644 --- a/internal/cmd/ske/cluster/update/update.go +++ b/internal/cmd/ske/cluster/update/update.go @@ -170,7 +170,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *ske.Cluster) error return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(resp) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE cluster: %w", err) } diff --git a/internal/cmd/ske/credentials/describe/describe.go b/internal/cmd/ske/credentials/describe/describe.go index a93fb8e0d..692bb9ace 100644 --- a/internal/cmd/ske/credentials/describe/describe.go +++ b/internal/cmd/ske/credentials/describe/describe.go @@ -124,7 +124,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *ske.Creden return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(credentials) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE credentials: %w", err) } diff --git a/internal/cmd/ske/describe/describe.go b/internal/cmd/ske/describe/describe.go index a14f018c7..433a60cd3 100644 --- a/internal/cmd/ske/describe/describe.go +++ b/internal/cmd/ske/describe/describe.go @@ -96,7 +96,7 @@ func outputResult(p *print.Printer, outputFormat string, project *ske.ProjectRes return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(project) + details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE project details: %w", err) } diff --git a/internal/cmd/ske/kubeconfig/create/create.go b/internal/cmd/ske/kubeconfig/create/create.go index 47309897d..d72c54b9c 100644 --- a/internal/cmd/ske/kubeconfig/create/create.go +++ b/internal/cmd/ske/kubeconfig/create/create.go @@ -230,9 +230,9 @@ func outputResult(p *print.Printer, model *inputModel, kubeconfigPath string, re var err error var details []byte if respKubeconfig != nil { - details, err = yaml.Marshal(respKubeconfig) + details, err = yaml.MarshalWithOptions(respKubeconfig, yaml.IndentSequence(true)) } else if respLogin != nil { - details, err = yaml.Marshal(respLogin) + details, err = yaml.MarshalWithOptions(respLogin, yaml.IndentSequence(true)) } if err != nil { return fmt.Errorf("marshal SKE Kubeconfig: %w", err) diff --git a/internal/cmd/ske/options/options.go b/internal/cmd/ske/options/options.go index 4f152f629..7bc3a5607 100644 --- a/internal/cmd/ske/options/options.go +++ b/internal/cmd/ske/options/options.go @@ -144,7 +144,7 @@ func outputResult(p *print.Printer, model *inputModel, options *ske.ProviderOpti p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.Marshal(options) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) if err != nil { return fmt.Errorf("marshal SKE options: %w", err) }