From f0fe3ba6e7156b0c77e67b922997a94cfefc7155 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 10 Feb 2025 17:41:42 +0100 Subject: [PATCH] Add `yaml.UseJSONMarshaler()` to all `yaml.MarshalWithOptions()`` calls --- internal/cmd/beta/image/create/create.go | 2 +- internal/cmd/beta/image/list/list.go | 2 +- internal/cmd/beta/key-pair/create/create.go | 2 +- internal/cmd/beta/key-pair/describe/describe.go | 4 ++-- internal/cmd/beta/key-pair/list/list.go | 2 +- internal/cmd/beta/key-pair/update/update.go | 2 +- internal/cmd/beta/network-area/create/create.go | 2 +- internal/cmd/beta/network-area/describe/describe.go | 2 +- internal/cmd/beta/network-area/list/list.go | 2 +- internal/cmd/beta/network-area/network-range/create/create.go | 2 +- .../cmd/beta/network-area/network-range/describe/describe.go | 2 +- internal/cmd/beta/network-area/network-range/list/list.go | 2 +- internal/cmd/beta/network-area/route/create/create.go | 2 +- internal/cmd/beta/network-area/route/describe/describe.go | 2 +- internal/cmd/beta/network-area/route/list/list.go | 2 +- internal/cmd/beta/network-area/route/update/update.go | 2 +- internal/cmd/beta/network-area/update/update.go | 2 +- internal/cmd/beta/network-interface/create/create.go | 2 +- internal/cmd/beta/network-interface/describe/describe.go | 2 +- internal/cmd/beta/network-interface/list/list.go | 2 +- internal/cmd/beta/network-interface/update/update.go | 2 +- internal/cmd/beta/network/create/create.go | 2 +- internal/cmd/beta/network/describe/describe.go | 2 +- internal/cmd/beta/network/list/list.go | 2 +- internal/cmd/beta/public-ip/create/create.go | 2 +- internal/cmd/beta/public-ip/describe/describe.go | 2 +- internal/cmd/beta/public-ip/list/list.go | 2 +- internal/cmd/beta/public-ip/update/update.go | 2 +- internal/cmd/beta/security-group/create/create.go | 2 +- internal/cmd/beta/security-group/describe/describe.go | 2 +- internal/cmd/beta/security-group/list/list.go | 2 +- internal/cmd/beta/security-group/rule/create/create.go | 2 +- internal/cmd/beta/security-group/rule/describe/describe.go | 2 +- internal/cmd/beta/security-group/rule/list/list.go | 2 +- internal/cmd/beta/server/backup/create/create.go | 2 +- internal/cmd/beta/server/backup/describe/describe.go | 2 +- internal/cmd/beta/server/backup/list/list.go | 2 +- internal/cmd/beta/server/backup/schedule/create/create.go | 2 +- internal/cmd/beta/server/backup/schedule/describe/describe.go | 2 +- internal/cmd/beta/server/backup/schedule/list/list.go | 2 +- internal/cmd/beta/server/backup/schedule/update/update.go | 2 +- internal/cmd/beta/server/command/create/create.go | 2 +- internal/cmd/beta/server/command/describe/describe.go | 2 +- internal/cmd/beta/server/command/list/list.go | 2 +- .../cmd/beta/server/command/template/describe/describe.go | 2 +- internal/cmd/beta/server/command/template/list/list.go | 2 +- internal/cmd/beta/server/console/console.go | 2 +- internal/cmd/beta/server/create/create.go | 2 +- internal/cmd/beta/server/describe/describe.go | 2 +- internal/cmd/beta/server/list/list.go | 2 +- internal/cmd/beta/server/log/log.go | 2 +- internal/cmd/beta/server/machine-type/describe/describe.go | 2 +- internal/cmd/beta/server/machine-type/list/list.go | 2 +- internal/cmd/beta/server/network-interface/list/list.go | 2 +- internal/cmd/beta/server/os-update/create/create.go | 2 +- internal/cmd/beta/server/os-update/describe/describe.go | 2 +- internal/cmd/beta/server/os-update/list/list.go | 2 +- internal/cmd/beta/server/os-update/schedule/create/create.go | 2 +- .../cmd/beta/server/os-update/schedule/describe/describe.go | 2 +- internal/cmd/beta/server/os-update/schedule/list/list.go | 2 +- internal/cmd/beta/server/os-update/schedule/update/update.go | 2 +- internal/cmd/beta/server/service-account/attach/attach.go | 2 +- internal/cmd/beta/server/service-account/detach/detach.go | 2 +- internal/cmd/beta/server/service-account/list/list.go | 2 +- internal/cmd/beta/server/update/update.go | 2 +- internal/cmd/beta/server/volume/attach/attach.go | 2 +- internal/cmd/beta/server/volume/describe/describe.go | 2 +- internal/cmd/beta/server/volume/list/list.go | 2 +- internal/cmd/beta/server/volume/update/update.go | 2 +- internal/cmd/beta/sqlserverflex/database/create/create.go | 2 +- internal/cmd/beta/sqlserverflex/database/describe/describe.go | 2 +- internal/cmd/beta/sqlserverflex/database/list/list.go | 2 +- internal/cmd/beta/sqlserverflex/instance/create/create.go | 2 +- internal/cmd/beta/sqlserverflex/instance/describe/describe.go | 2 +- internal/cmd/beta/sqlserverflex/instance/list/list.go | 2 +- internal/cmd/beta/sqlserverflex/instance/update/update.go | 2 +- internal/cmd/beta/sqlserverflex/options/options.go | 2 +- internal/cmd/beta/sqlserverflex/user/create/create.go | 2 +- internal/cmd/beta/sqlserverflex/user/describe/describe.go | 2 +- internal/cmd/beta/sqlserverflex/user/list/list.go | 2 +- .../beta/sqlserverflex/user/reset-password/reset_password.go | 2 +- internal/cmd/beta/volume/create/create.go | 2 +- internal/cmd/beta/volume/describe/describe.go | 2 +- internal/cmd/beta/volume/list/list.go | 2 +- .../cmd/beta/volume/performance-class/describe/describe.go | 2 +- internal/cmd/beta/volume/performance-class/list/list.go | 2 +- internal/cmd/beta/volume/update/update.go | 2 +- internal/cmd/config/list/list.go | 2 +- internal/cmd/config/profile/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/clone/clone.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/observability/credentials/create/create.go | 2 +- internal/cmd/observability/credentials/list/list.go | 2 +- internal/cmd/observability/grafana/describe/describe.go | 2 +- internal/cmd/observability/instance/create/create.go | 2 +- internal/cmd/observability/instance/describe/describe.go | 2 +- internal/cmd/observability/instance/list/list.go | 2 +- internal/cmd/observability/plans/plans.go | 2 +- internal/cmd/observability/scrape-config/describe/describe.go | 2 +- internal/cmd/observability/scrape-config/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/describe/describe.go | 2 +- internal/cmd/ske/kubeconfig/create/create.go | 4 ++-- internal/cmd/ske/options/options.go | 2 +- 204 files changed, 206 insertions(+), 206 deletions(-) diff --git a/internal/cmd/beta/image/create/create.go b/internal/cmd/beta/image/create/create.go index 7b259010e..1203f70a6 100644 --- a/internal/cmd/beta/image/create/create.go +++ b/internal/cmd/beta/image/create/create.go @@ -387,7 +387,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *iaas.ImageCreateRes return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal image: %w", err) } diff --git a/internal/cmd/beta/image/list/list.go b/internal/cmd/beta/image/list/list.go index 1447f75a7..2452c7443 100644 --- a/internal/cmd/beta/image/list/list.go +++ b/internal/cmd/beta/image/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, outputFormat string, items []iaas.Image) err return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(items, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(items, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal image list: %w", err) } diff --git a/internal/cmd/beta/key-pair/create/create.go b/internal/cmd/beta/key-pair/create/create.go index b4bd759bb..a69d75505 100644 --- a/internal/cmd/beta/key-pair/create/create.go +++ b/internal/cmd/beta/key-pair/create/create.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, outputFormat string, item *iaas.Keypair) err } p.Outputln(string(details)) case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(item, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(item, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal key pair: %w", err) } diff --git a/internal/cmd/beta/key-pair/describe/describe.go b/internal/cmd/beta/key-pair/describe/describe.go index 85981bde3..b9efb0907 100644 --- a/internal/cmd/beta/key-pair/describe/describe.go +++ b/internal/cmd/beta/key-pair/describe/describe.go @@ -131,12 +131,12 @@ func outputResult(p *print.Printer, outputFormat string, showOnlyPublicKey bool, return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if showOnlyPublicKey { onlyPublicKey := map[string]string{ "publicKey": *keyPair.PublicKey, } - details, err = yaml.MarshalWithOptions(onlyPublicKey, yaml.IndentSequence(true)) + details, err = yaml.MarshalWithOptions(onlyPublicKey, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) } if err != nil { diff --git a/internal/cmd/beta/key-pair/list/list.go b/internal/cmd/beta/key-pair/list/list.go index b25e6d6f6..9a1c9c624 100644 --- a/internal/cmd/beta/key-pair/list/list.go +++ b/internal/cmd/beta/key-pair/list/list.go @@ -146,7 +146,7 @@ func outputResult(p *print.Printer, outputFormat string, keyPairs []iaas.Keypair p.Outputln(string(details)) case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(keyPairs, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(keyPairs, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal key pairs: %w", err) } diff --git a/internal/cmd/beta/key-pair/update/update.go b/internal/cmd/beta/key-pair/update/update.go index de9b9f5d4..90cf02e07 100644 --- a/internal/cmd/beta/key-pair/update/update.go +++ b/internal/cmd/beta/key-pair/update/update.go @@ -135,7 +135,7 @@ func outputResult(p *print.Printer, model inputModel, keyPair iaas.Keypair) erro } p.Outputln(string(details)) case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(keyPair, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal key pair: %w", err) } diff --git a/internal/cmd/beta/network-area/create/create.go b/internal/cmd/beta/network-area/create/create.go index 576fd8904..2df562c6d 100644 --- a/internal/cmd/beta/network-area/create/create.go +++ b/internal/cmd/beta/network-area/create/create.go @@ -189,7 +189,7 @@ func outputResult(p *print.Printer, model *inputModel, orgLabel string, networkA return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network area: %w", err) } diff --git a/internal/cmd/beta/network-area/describe/describe.go b/internal/cmd/beta/network-area/describe/describe.go index 61c329af9..13d2707d4 100644 --- a/internal/cmd/beta/network-area/describe/describe.go +++ b/internal/cmd/beta/network-area/describe/describe.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, outputFormat string, networkArea *iaas.Netwo return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network area: %w", err) } diff --git a/internal/cmd/beta/network-area/list/list.go b/internal/cmd/beta/network-area/list/list.go index 984ebb4df..cb4916a79 100644 --- a/internal/cmd/beta/network-area/list/list.go +++ b/internal/cmd/beta/network-area/list/list.go @@ -152,7 +152,7 @@ func outputResult(p *print.Printer, outputFormat string, networkAreas []iaas.Net return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkAreas, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkAreas, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal area: %w", err) } diff --git a/internal/cmd/beta/network-area/network-range/create/create.go b/internal/cmd/beta/network-area/network-range/create/create.go index 4efb43d49..812ea18a7 100644 --- a/internal/cmd/beta/network-area/network-range/create/create.go +++ b/internal/cmd/beta/network-area/network-range/create/create.go @@ -149,7 +149,7 @@ func outputResult(p *print.Printer, model *inputModel, networkAreaLabel string, return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network range: %w", err) } diff --git a/internal/cmd/beta/network-area/network-range/describe/describe.go b/internal/cmd/beta/network-area/network-range/describe/describe.go index 8ca934686..f97fc0b57 100644 --- a/internal/cmd/beta/network-area/network-range/describe/describe.go +++ b/internal/cmd/beta/network-area/network-range/describe/describe.go @@ -119,7 +119,7 @@ func outputResult(p *print.Printer, outputFormat string, networkRange *iaas.Netw return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkRange, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network range: %w", err) } diff --git a/internal/cmd/beta/network-area/network-range/list/list.go b/internal/cmd/beta/network-area/network-range/list/list.go index b5b28f688..e2115d9a7 100644 --- a/internal/cmd/beta/network-area/network-range/list/list.go +++ b/internal/cmd/beta/network-area/network-range/list/list.go @@ -150,7 +150,7 @@ func outputResult(p *print.Printer, outputFormat string, networkRanges []iaas.Ne return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkRanges, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkRanges, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network ranges: %w", err) } diff --git a/internal/cmd/beta/network-area/route/create/create.go b/internal/cmd/beta/network-area/route/create/create.go index a6f14b1c8..e1b330329 100644 --- a/internal/cmd/beta/network-area/route/create/create.go +++ b/internal/cmd/beta/network-area/route/create/create.go @@ -176,7 +176,7 @@ func outputResult(p *print.Printer, model *inputModel, networkAreaLabel string, return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal static route: %w", err) } diff --git a/internal/cmd/beta/network-area/route/describe/describe.go b/internal/cmd/beta/network-area/route/describe/describe.go index 9a4c91300..2e99f8c67 100644 --- a/internal/cmd/beta/network-area/route/describe/describe.go +++ b/internal/cmd/beta/network-area/route/describe/describe.go @@ -124,7 +124,7 @@ func outputResult(p *print.Printer, outputFormat string, route *iaas.Route) erro return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal static route: %w", err) } diff --git a/internal/cmd/beta/network-area/route/list/list.go b/internal/cmd/beta/network-area/route/list/list.go index 6d5baa093..c948e271a 100644 --- a/internal/cmd/beta/network-area/route/list/list.go +++ b/internal/cmd/beta/network-area/route/list/list.go @@ -150,7 +150,7 @@ func outputResult(p *print.Printer, outputFormat string, routes []iaas.Route) er return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(routes, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(routes, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal static routes: %w", err) } diff --git a/internal/cmd/beta/network-area/route/update/update.go b/internal/cmd/beta/network-area/route/update/update.go index f022e0d2d..511f9ed4d 100644 --- a/internal/cmd/beta/network-area/route/update/update.go +++ b/internal/cmd/beta/network-area/route/update/update.go @@ -152,7 +152,7 @@ func outputResult(p *print.Printer, model *inputModel, networkAreaLabel string, return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(route, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal static route: %w", err) } diff --git a/internal/cmd/beta/network-area/update/update.go b/internal/cmd/beta/network-area/update/update.go index c59a80af1..a7d7bb722 100644 --- a/internal/cmd/beta/network-area/update/update.go +++ b/internal/cmd/beta/network-area/update/update.go @@ -171,7 +171,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, netw return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networkArea, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network area: %w", err) } diff --git a/internal/cmd/beta/network-interface/create/create.go b/internal/cmd/beta/network-interface/create/create.go index ac3686652..99fa2dc7f 100644 --- a/internal/cmd/beta/network-interface/create/create.go +++ b/internal/cmd/beta/network-interface/create/create.go @@ -237,7 +237,7 @@ func outputResult(p *print.Printer, model *inputModel, nic *iaas.NIC) error { return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network interface: %w", err) } diff --git a/internal/cmd/beta/network-interface/describe/describe.go b/internal/cmd/beta/network-interface/describe/describe.go index 02332642f..c83e79897 100644 --- a/internal/cmd/beta/network-interface/describe/describe.go +++ b/internal/cmd/beta/network-interface/describe/describe.go @@ -127,7 +127,7 @@ func outputResult(p *print.Printer, outputFormat string, nic *iaas.NIC) error { return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network interface: %w", err) } diff --git a/internal/cmd/beta/network-interface/list/list.go b/internal/cmd/beta/network-interface/list/list.go index 994cdf096..4b8d6b314 100644 --- a/internal/cmd/beta/network-interface/list/list.go +++ b/internal/cmd/beta/network-interface/list/list.go @@ -162,7 +162,7 @@ func outputResult(p *print.Printer, outputFormat string, nics []iaas.NIC) error return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(nics, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(nics, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal nics: %w", err) } diff --git a/internal/cmd/beta/network-interface/update/update.go b/internal/cmd/beta/network-interface/update/update.go index 5128e26cc..2b74557ac 100644 --- a/internal/cmd/beta/network-interface/update/update.go +++ b/internal/cmd/beta/network-interface/update/update.go @@ -229,7 +229,7 @@ func outputResult(p *print.Printer, model *inputModel, nic *iaas.NIC) error { return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(nic, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network interface: %w", err) } diff --git a/internal/cmd/beta/network/create/create.go b/internal/cmd/beta/network/create/create.go index 74abb08a4..e3832171b 100644 --- a/internal/cmd/beta/network/create/create.go +++ b/internal/cmd/beta/network/create/create.go @@ -245,7 +245,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, netw return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(network, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(network, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network: %w", err) } diff --git a/internal/cmd/beta/network/describe/describe.go b/internal/cmd/beta/network/describe/describe.go index 26efcc3dc..6bdb139af 100644 --- a/internal/cmd/beta/network/describe/describe.go +++ b/internal/cmd/beta/network/describe/describe.go @@ -111,7 +111,7 @@ func outputResult(p *print.Printer, outputFormat string, network *iaas.Network) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(network, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(network, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network: %w", err) } diff --git a/internal/cmd/beta/network/list/list.go b/internal/cmd/beta/network/list/list.go index 62ca68e6f..71cff5509 100644 --- a/internal/cmd/beta/network/list/list.go +++ b/internal/cmd/beta/network/list/list.go @@ -143,7 +143,7 @@ func outputResult(p *print.Printer, outputFormat string, networks []iaas.Network return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(networks, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(networks, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal network: %w", err) } diff --git a/internal/cmd/beta/public-ip/create/create.go b/internal/cmd/beta/public-ip/create/create.go index dd1db3e5f..ad6196e82 100644 --- a/internal/cmd/beta/public-ip/create/create.go +++ b/internal/cmd/beta/public-ip/create/create.go @@ -151,7 +151,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, publ return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal public IP: %w", err) } diff --git a/internal/cmd/beta/public-ip/describe/describe.go b/internal/cmd/beta/public-ip/describe/describe.go index 19d03a4c9..c07e9e981 100644 --- a/internal/cmd/beta/public-ip/describe/describe.go +++ b/internal/cmd/beta/public-ip/describe/describe.go @@ -112,7 +112,7 @@ func outputResult(p *print.Printer, outputFormat string, publicIp *iaas.PublicIp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal public IP: %w", err) } diff --git a/internal/cmd/beta/public-ip/list/list.go b/internal/cmd/beta/public-ip/list/list.go index 2ac5b56ba..2293600aa 100644 --- a/internal/cmd/beta/public-ip/list/list.go +++ b/internal/cmd/beta/public-ip/list/list.go @@ -156,7 +156,7 @@ func outputResult(p *print.Printer, outputFormat string, publicIps []iaas.Public return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(publicIps, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(publicIps, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal public IP: %w", err) } diff --git a/internal/cmd/beta/public-ip/update/update.go b/internal/cmd/beta/public-ip/update/update.go index 58c77e73c..e36d92a70 100644 --- a/internal/cmd/beta/public-ip/update/update.go +++ b/internal/cmd/beta/public-ip/update/update.go @@ -156,7 +156,7 @@ func outputResult(p *print.Printer, model *inputModel, publicIpLabel string, pub return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(publicIp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal public IP: %w", err) } diff --git a/internal/cmd/beta/security-group/create/create.go b/internal/cmd/beta/security-group/create/create.go index e70273a44..1f7072e29 100644 --- a/internal/cmd/beta/security-group/create/create.go +++ b/internal/cmd/beta/security-group/create/create.go @@ -155,7 +155,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *iaas.SecurityGroup) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal security group: %w", err) } diff --git a/internal/cmd/beta/security-group/describe/describe.go b/internal/cmd/beta/security-group/describe/describe.go index 2a01e8515..2feb18203 100644 --- a/internal/cmd/beta/security-group/describe/describe.go +++ b/internal/cmd/beta/security-group/describe/describe.go @@ -107,7 +107,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *iaas.SecurityGroup) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal security group: %w", err) } diff --git a/internal/cmd/beta/security-group/list/list.go b/internal/cmd/beta/security-group/list/list.go index 9ecb4a360..e9a4e31cf 100644 --- a/internal/cmd/beta/security-group/list/list.go +++ b/internal/cmd/beta/security-group/list/list.go @@ -129,7 +129,7 @@ func outputResult(p *print.Printer, outputFormat string, items []iaas.SecurityGr return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(items, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(items, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal PostgreSQL Flex instance list: %w", err) } diff --git a/internal/cmd/beta/security-group/rule/create/create.go b/internal/cmd/beta/security-group/rule/create/create.go index 2dcd875b6..2d8958e27 100644 --- a/internal/cmd/beta/security-group/rule/create/create.go +++ b/internal/cmd/beta/security-group/rule/create/create.go @@ -229,7 +229,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel, securityGro return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(securityGroupRule, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(securityGroupRule, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal security group rule: %w", err) } diff --git a/internal/cmd/beta/security-group/rule/describe/describe.go b/internal/cmd/beta/security-group/rule/describe/describe.go index 64ff2834d..5c1ef384f 100644 --- a/internal/cmd/beta/security-group/rule/describe/describe.go +++ b/internal/cmd/beta/security-group/rule/describe/describe.go @@ -123,7 +123,7 @@ func outputResult(p *print.Printer, outputFormat string, securityGroupRule *iaas return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(securityGroupRule, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(securityGroupRule, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal security group rule: %w", err) } diff --git a/internal/cmd/beta/security-group/rule/list/list.go b/internal/cmd/beta/security-group/rule/list/list.go index 385b98dd8..4e8d63481 100644 --- a/internal/cmd/beta/security-group/rule/list/list.go +++ b/internal/cmd/beta/security-group/rule/list/list.go @@ -158,7 +158,7 @@ func outputResult(p *print.Printer, outputFormat string, securityGroupRules []ia return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(securityGroupRules, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(securityGroupRules, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal security group rules: %w", err) } diff --git a/internal/cmd/beta/server/backup/create/create.go b/internal/cmd/beta/server/backup/create/create.go index 2ae95c259..f53f3b9ef 100644 --- a/internal/cmd/beta/server/backup/create/create.go +++ b/internal/cmd/beta/server/backup/create/create.go @@ -151,7 +151,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverbackup.Backup return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server backup: %w", err) } diff --git a/internal/cmd/beta/server/backup/describe/describe.go b/internal/cmd/beta/server/backup/describe/describe.go index a14f7a64d..3396fd18c 100644 --- a/internal/cmd/beta/server/backup/describe/describe.go +++ b/internal/cmd/beta/server/backup/describe/describe.go @@ -120,7 +120,7 @@ func outputResult(p *print.Printer, outputFormat string, backup *serverbackup.Ba return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server backup: %w", err) } diff --git a/internal/cmd/beta/server/backup/list/list.go b/internal/cmd/beta/server/backup/list/list.go index f5c2dbf0e..244444766 100644 --- a/internal/cmd/beta/server/backup/list/list.go +++ b/internal/cmd/beta/server/backup/list/list.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, backups []serverbackup. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Server Backup list: %w", err) } diff --git a/internal/cmd/beta/server/backup/schedule/create/create.go b/internal/cmd/beta/server/backup/schedule/create/create.go index e35755d8e..dc10d8bcd 100644 --- a/internal/cmd/beta/server/backup/schedule/create/create.go +++ b/internal/cmd/beta/server/backup/schedule/create/create.go @@ -170,7 +170,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverbackup.Backup return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server backup schedule: %w", err) } diff --git a/internal/cmd/beta/server/backup/schedule/describe/describe.go b/internal/cmd/beta/server/backup/schedule/describe/describe.go index c94144658..7c91a0bee 100644 --- a/internal/cmd/beta/server/backup/schedule/describe/describe.go +++ b/internal/cmd/beta/server/backup/schedule/describe/describe.go @@ -120,7 +120,7 @@ func outputResult(p *print.Printer, outputFormat string, schedule *serverbackup. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(schedule, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(schedule, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server backup schedule: %w", err) } diff --git a/internal/cmd/beta/server/backup/schedule/list/list.go b/internal/cmd/beta/server/backup/schedule/list/list.go index 0709f81bd..366d6a09b 100644 --- a/internal/cmd/beta/server/backup/schedule/list/list.go +++ b/internal/cmd/beta/server/backup/schedule/list/list.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, schedules []serverbacku return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(schedules, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(schedules, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Server Backup Schedules list: %w", err) } diff --git a/internal/cmd/beta/server/backup/schedule/update/update.go b/internal/cmd/beta/server/backup/schedule/update/update.go index 88691fc82..02fe6c92a 100644 --- a/internal/cmd/beta/server/backup/schedule/update/update.go +++ b/internal/cmd/beta/server/backup/schedule/update/update.go @@ -195,7 +195,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverbackup.Backup return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal update server backup schedule: %w", err) } diff --git a/internal/cmd/beta/server/command/create/create.go b/internal/cmd/beta/server/command/create/create.go index 15d3a0d40..2729653f7 100644 --- a/internal/cmd/beta/server/command/create/create.go +++ b/internal/cmd/beta/server/command/create/create.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *runcommand.NewComma return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server command: %w", err) } diff --git a/internal/cmd/beta/server/command/describe/describe.go b/internal/cmd/beta/server/command/describe/describe.go index e7964c189..7bc408969 100644 --- a/internal/cmd/beta/server/command/describe/describe.go +++ b/internal/cmd/beta/server/command/describe/describe.go @@ -119,7 +119,7 @@ func outputResult(p *print.Printer, outputFormat string, command *runcommand.Com return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(command, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(command, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server command: %w", err) } diff --git a/internal/cmd/beta/server/command/list/list.go b/internal/cmd/beta/server/command/list/list.go index 5cdedac7d..5768eef26 100644 --- a/internal/cmd/beta/server/command/list/list.go +++ b/internal/cmd/beta/server/command/list/list.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, commands []runcommand.C return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(commands, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(commands, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server command list: %w", err) } diff --git a/internal/cmd/beta/server/command/template/describe/describe.go b/internal/cmd/beta/server/command/template/describe/describe.go index 054e81940..c44216b17 100644 --- a/internal/cmd/beta/server/command/template/describe/describe.go +++ b/internal/cmd/beta/server/command/template/describe/describe.go @@ -120,7 +120,7 @@ func outputResult(p *print.Printer, outputFormat string, commandTemplate *runcom return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(commandTemplate, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(commandTemplate, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server command template: %w", err) } diff --git a/internal/cmd/beta/server/command/template/list/list.go b/internal/cmd/beta/server/command/template/list/list.go index 03485da5a..5290173a2 100644 --- a/internal/cmd/beta/server/command/template/list/list.go +++ b/internal/cmd/beta/server/command/template/list/list.go @@ -129,7 +129,7 @@ func outputResult(p *print.Printer, outputFormat string, templates []runcommand. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(templates, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(templates, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server command template list: %w", err) } diff --git a/internal/cmd/beta/server/console/console.go b/internal/cmd/beta/server/console/console.go index 006936dcf..d5af1372e 100644 --- a/internal/cmd/beta/server/console/console.go +++ b/internal/cmd/beta/server/console/console.go @@ -119,7 +119,7 @@ func outputResult(p *print.Printer, model *inputModel, serverLabel string, serve return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(serverUrl, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serverUrl, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal url: %w", err) } diff --git a/internal/cmd/beta/server/create/create.go b/internal/cmd/beta/server/create/create.go index f1c4bf0cf..23a22a3ba 100644 --- a/internal/cmd/beta/server/create/create.go +++ b/internal/cmd/beta/server/create/create.go @@ -345,7 +345,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, serv return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server: %w", err) } diff --git a/internal/cmd/beta/server/describe/describe.go b/internal/cmd/beta/server/describe/describe.go index 0f69c92d6..3b4b0cef8 100644 --- a/internal/cmd/beta/server/describe/describe.go +++ b/internal/cmd/beta/server/describe/describe.go @@ -116,7 +116,7 @@ func outputResult(p *print.Printer, model *inputModel, server *iaas.Server) erro return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server: %w", err) } diff --git a/internal/cmd/beta/server/list/list.go b/internal/cmd/beta/server/list/list.go index 366d31e8f..b6a20939c 100644 --- a/internal/cmd/beta/server/list/list.go +++ b/internal/cmd/beta/server/list/list.go @@ -157,7 +157,7 @@ func outputResult(p *print.Printer, outputFormat string, servers []iaas.Server) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(servers, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(servers, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server: %w", err) } diff --git a/internal/cmd/beta/server/log/log.go b/internal/cmd/beta/server/log/log.go index 20e791b27..2de1b3246 100644 --- a/internal/cmd/beta/server/log/log.go +++ b/internal/cmd/beta/server/log/log.go @@ -151,7 +151,7 @@ func outputResult(p *print.Printer, model *inputModel, serverLabel, log string) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(log, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(log, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal url: %w", err) } diff --git a/internal/cmd/beta/server/machine-type/describe/describe.go b/internal/cmd/beta/server/machine-type/describe/describe.go index 4caf15d8b..6274f85ac 100644 --- a/internal/cmd/beta/server/machine-type/describe/describe.go +++ b/internal/cmd/beta/server/machine-type/describe/describe.go @@ -111,7 +111,7 @@ func outputResult(p *print.Printer, outputFormat string, machineType *iaas.Machi return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(machineType, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(machineType, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server machine type: %w", err) } diff --git a/internal/cmd/beta/server/machine-type/list/list.go b/internal/cmd/beta/server/machine-type/list/list.go index db378a1e7..ffa6343b5 100644 --- a/internal/cmd/beta/server/machine-type/list/list.go +++ b/internal/cmd/beta/server/machine-type/list/list.go @@ -145,7 +145,7 @@ func outputResult(p *print.Printer, model *inputModel, machineTypes *iaas.Machin return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(machineTypes, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(machineTypes, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal machineTypes: %w", err) } diff --git a/internal/cmd/beta/server/network-interface/list/list.go b/internal/cmd/beta/server/network-interface/list/list.go index b715527f4..8f0d3b928 100644 --- a/internal/cmd/beta/server/network-interface/list/list.go +++ b/internal/cmd/beta/server/network-interface/list/list.go @@ -149,7 +149,7 @@ func outputResult(p *print.Printer, outputFormat, serverId string, serverNics [] return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(serverNics, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serverNics, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server network interfaces: %w", err) } diff --git a/internal/cmd/beta/server/os-update/create/create.go b/internal/cmd/beta/server/os-update/create/create.go index 076a4d204..db998a374 100644 --- a/internal/cmd/beta/server/os-update/create/create.go +++ b/internal/cmd/beta/server/os-update/create/create.go @@ -134,7 +134,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverupdate.Update return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server os-update: %w", err) } diff --git a/internal/cmd/beta/server/os-update/describe/describe.go b/internal/cmd/beta/server/os-update/describe/describe.go index 2a3c1fbed..820edddda 100644 --- a/internal/cmd/beta/server/os-update/describe/describe.go +++ b/internal/cmd/beta/server/os-update/describe/describe.go @@ -119,7 +119,7 @@ func outputResult(p *print.Printer, outputFormat string, update *serverupdate.Up return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(update, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(update, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server update: %w", err) } diff --git a/internal/cmd/beta/server/os-update/list/list.go b/internal/cmd/beta/server/os-update/list/list.go index 5a25607dd..10e71108f 100644 --- a/internal/cmd/beta/server/os-update/list/list.go +++ b/internal/cmd/beta/server/os-update/list/list.go @@ -138,7 +138,7 @@ func outputResult(p *print.Printer, outputFormat string, updates []serverupdate. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(updates, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(updates, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server os-update list: %w", err) } diff --git a/internal/cmd/beta/server/os-update/schedule/create/create.go b/internal/cmd/beta/server/os-update/schedule/create/create.go index fb767e690..861ec9629 100644 --- a/internal/cmd/beta/server/os-update/schedule/create/create.go +++ b/internal/cmd/beta/server/os-update/schedule/create/create.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverupdate.Update return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server os-update schedule: %w", err) } diff --git a/internal/cmd/beta/server/os-update/schedule/describe/describe.go b/internal/cmd/beta/server/os-update/schedule/describe/describe.go index 33a5caefa..e0a20bf1f 100644 --- a/internal/cmd/beta/server/os-update/schedule/describe/describe.go +++ b/internal/cmd/beta/server/os-update/schedule/describe/describe.go @@ -119,7 +119,7 @@ func outputResult(p *print.Printer, outputFormat string, schedule *serverupdate. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(schedule, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(schedule, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server os-update schedule: %w", err) } diff --git a/internal/cmd/beta/server/os-update/schedule/list/list.go b/internal/cmd/beta/server/os-update/schedule/list/list.go index b9d1f0cff..8efd95198 100644 --- a/internal/cmd/beta/server/os-update/schedule/list/list.go +++ b/internal/cmd/beta/server/os-update/schedule/list/list.go @@ -136,7 +136,7 @@ func outputResult(p *print.Printer, outputFormat string, schedules []serverupdat return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(schedules, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(schedules, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Server os-update Schedules list: %w", err) } diff --git a/internal/cmd/beta/server/os-update/schedule/update/update.go b/internal/cmd/beta/server/os-update/schedule/update/update.go index 5b8251d70..7b4b057a3 100644 --- a/internal/cmd/beta/server/os-update/schedule/update/update.go +++ b/internal/cmd/beta/server/os-update/schedule/update/update.go @@ -177,7 +177,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *serverupdate.Update return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal update server os-update schedule: %w", err) } diff --git a/internal/cmd/beta/server/service-account/attach/attach.go b/internal/cmd/beta/server/service-account/attach/attach.go index 00dd4ac8c..87bfbaa31 100644 --- a/internal/cmd/beta/server/service-account/attach/attach.go +++ b/internal/cmd/beta/server/service-account/attach/attach.go @@ -131,7 +131,7 @@ func outputResult(p *print.Printer, outputFormat, serviceAccMail, serverLabel st return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal service account: %w", err) } diff --git a/internal/cmd/beta/server/service-account/detach/detach.go b/internal/cmd/beta/server/service-account/detach/detach.go index 954463974..7c5587842 100644 --- a/internal/cmd/beta/server/service-account/detach/detach.go +++ b/internal/cmd/beta/server/service-account/detach/detach.go @@ -131,7 +131,7 @@ func outputResult(p *print.Printer, outputFormat, serviceAccMail, serverLabel st return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(service, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(service, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal service account: %w", err) } diff --git a/internal/cmd/beta/server/service-account/list/list.go b/internal/cmd/beta/server/service-account/list/list.go index c938f2b80..e02b9d3ae 100644 --- a/internal/cmd/beta/server/service-account/list/list.go +++ b/internal/cmd/beta/server/service-account/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat, serverId, serverName string, s return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal service accounts list: %w", err) } diff --git a/internal/cmd/beta/server/update/update.go b/internal/cmd/beta/server/update/update.go index 6d4a39d7f..9067d5a45 100644 --- a/internal/cmd/beta/server/update/update.go +++ b/internal/cmd/beta/server/update/update.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, model *inputModel, serverLabel string, serve return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server: %w", err) } diff --git a/internal/cmd/beta/server/volume/attach/attach.go b/internal/cmd/beta/server/volume/attach/attach.go index ba020e467..25b2a722a 100644 --- a/internal/cmd/beta/server/volume/attach/attach.go +++ b/internal/cmd/beta/server/volume/attach/attach.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, outputFormat, volumeLabel, serverLabel strin return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server volume: %w", err) } diff --git a/internal/cmd/beta/server/volume/describe/describe.go b/internal/cmd/beta/server/volume/describe/describe.go index cc77e843d..29648759e 100644 --- a/internal/cmd/beta/server/volume/describe/describe.go +++ b/internal/cmd/beta/server/volume/describe/describe.go @@ -138,7 +138,7 @@ func outputResult(p *print.Printer, outputFormat, serverLabel, volumeLabel strin return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server volume: %w", err) } diff --git a/internal/cmd/beta/server/volume/list/list.go b/internal/cmd/beta/server/volume/list/list.go index eefc47f94..f6f39e7ad 100644 --- a/internal/cmd/beta/server/volume/list/list.go +++ b/internal/cmd/beta/server/volume/list/list.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, outputFormat, serverLabel string, volumeName return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volumes, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volumes, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server volume list: %w", err) } diff --git a/internal/cmd/beta/server/volume/update/update.go b/internal/cmd/beta/server/volume/update/update.go index 41252e79f..289593b65 100644 --- a/internal/cmd/beta/server/volume/update/update.go +++ b/internal/cmd/beta/server/volume/update/update.go @@ -150,7 +150,7 @@ func outputResult(p *print.Printer, outputFormat, volumeLabel, serverLabel strin return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal server volume: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/database/create/create.go b/internal/cmd/beta/sqlserverflex/database/create/create.go index fa3467d2d..920d06c9b 100644 --- a/internal/cmd/beta/sqlserverflex/database/create/create.go +++ b/internal/cmd/beta/sqlserverflex/database/create/create.go @@ -143,7 +143,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *sqlserverflex.Creat return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex database: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/database/describe/describe.go b/internal/cmd/beta/sqlserverflex/database/describe/describe.go index 009ebfc0c..750488b50 100644 --- a/internal/cmd/beta/sqlserverflex/database/describe/describe.go +++ b/internal/cmd/beta/sqlserverflex/database/describe/describe.go @@ -120,7 +120,7 @@ func outputResult(p *print.Printer, outputFormat string, database *sqlserverflex return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(database, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(database, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex database: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/database/list/list.go b/internal/cmd/beta/sqlserverflex/database/list/list.go index aac09fc65..195dc860b 100644 --- a/internal/cmd/beta/sqlserverflex/database/list/list.go +++ b/internal/cmd/beta/sqlserverflex/database/list/list.go @@ -147,7 +147,7 @@ func outputResult(p *print.Printer, outputFormat string, databases []sqlserverfl return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(databases, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(databases, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex database list: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/instance/create/create.go b/internal/cmd/beta/sqlserverflex/instance/create/create.go index 82ec72f8b..c4e7b3877 100644 --- a/internal/cmd/beta/sqlserverflex/instance/create/create.go +++ b/internal/cmd/beta/sqlserverflex/instance/create/create.go @@ -272,7 +272,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServerFlex instance: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/instance/describe/describe.go b/internal/cmd/beta/sqlserverflex/instance/describe/describe.go index 59525c85d..11a4ac39b 100644 --- a/internal/cmd/beta/sqlserverflex/instance/describe/describe.go +++ b/internal/cmd/beta/sqlserverflex/instance/describe/describe.go @@ -109,7 +109,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *sqlserverflex return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex instance: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/instance/list/list.go b/internal/cmd/beta/sqlserverflex/instance/list/list.go index b524c088a..855273e5f 100644 --- a/internal/cmd/beta/sqlserverflex/instance/list/list.go +++ b/internal/cmd/beta/sqlserverflex/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []sqlserverfl return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex instance list: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/instance/update/update.go b/internal/cmd/beta/sqlserverflex/instance/update/update.go index 67ffc6acd..f1a53a3e6 100644 --- a/internal/cmd/beta/sqlserverflex/instance/update/update.go +++ b/internal/cmd/beta/sqlserverflex/instance/update/update.go @@ -257,7 +257,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal update SQLServerFlex instance: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/options/options.go b/internal/cmd/beta/sqlserverflex/options/options.go index 1a3763735..8d8e2c681 100644 --- a/internal/cmd/beta/sqlserverflex/options/options.go +++ b/internal/cmd/beta/sqlserverflex/options/options.go @@ -287,7 +287,7 @@ func outputResult(p *print.Printer, model *inputModel, flavors *sqlserverflex.Li p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQL Server Flex options: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/user/create/create.go b/internal/cmd/beta/sqlserverflex/user/create/create.go index 7153f4dca..82740c25a 100644 --- a/internal/cmd/beta/sqlserverflex/user/create/create.go +++ b/internal/cmd/beta/sqlserverflex/user/create/create.go @@ -154,7 +154,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, use return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex user: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/user/describe/describe.go b/internal/cmd/beta/sqlserverflex/user/describe/describe.go index a679a3e05..ec54158df 100644 --- a/internal/cmd/beta/sqlserverflex/user/describe/describe.go +++ b/internal/cmd/beta/sqlserverflex/user/describe/describe.go @@ -129,7 +129,7 @@ func outputResult(p *print.Printer, outputFormat string, user sqlserverflex.User return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex user: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/user/list/list.go b/internal/cmd/beta/sqlserverflex/user/list/list.go index 32f9d1557..e2600d2fa 100644 --- a/internal/cmd/beta/sqlserverflex/user/list/list.go +++ b/internal/cmd/beta/sqlserverflex/user/list/list.go @@ -148,7 +148,7 @@ func outputResult(p *print.Printer, outputFormat string, users []sqlserverflex.I return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex user list: %w", err) } diff --git a/internal/cmd/beta/sqlserverflex/user/reset-password/reset_password.go b/internal/cmd/beta/sqlserverflex/user/reset-password/reset_password.go index 6218406a6..5cb34aa27 100644 --- a/internal/cmd/beta/sqlserverflex/user/reset-password/reset_password.go +++ b/internal/cmd/beta/sqlserverflex/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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SQLServer Flex reset password: %w", err) } diff --git a/internal/cmd/beta/volume/create/create.go b/internal/cmd/beta/volume/create/create.go index 0374c5f46..38cfdbe4f 100644 --- a/internal/cmd/beta/volume/create/create.go +++ b/internal/cmd/beta/volume/create/create.go @@ -209,7 +209,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, volu return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume: %w", err) } diff --git a/internal/cmd/beta/volume/describe/describe.go b/internal/cmd/beta/volume/describe/describe.go index c62a0cedf..4dab40860 100644 --- a/internal/cmd/beta/volume/describe/describe.go +++ b/internal/cmd/beta/volume/describe/describe.go @@ -112,7 +112,7 @@ func outputResult(p *print.Printer, outputFormat string, volume *iaas.Volume) er return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume: %w", err) } diff --git a/internal/cmd/beta/volume/list/list.go b/internal/cmd/beta/volume/list/list.go index a9920f438..f283037a3 100644 --- a/internal/cmd/beta/volume/list/list.go +++ b/internal/cmd/beta/volume/list/list.go @@ -155,7 +155,7 @@ func outputResult(p *print.Printer, outputFormat string, volumes []iaas.Volume) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volumes, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volumes, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume: %w", err) } diff --git a/internal/cmd/beta/volume/performance-class/describe/describe.go b/internal/cmd/beta/volume/performance-class/describe/describe.go index b867f2e70..6ed6c261b 100644 --- a/internal/cmd/beta/volume/performance-class/describe/describe.go +++ b/internal/cmd/beta/volume/performance-class/describe/describe.go @@ -112,7 +112,7 @@ func outputResult(p *print.Printer, outputFormat string, performanceClass *iaas. return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(performanceClass, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(performanceClass, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume performance class: %w", err) } diff --git a/internal/cmd/beta/volume/performance-class/list/list.go b/internal/cmd/beta/volume/performance-class/list/list.go index 3bc6ed37f..9e51bd0d6 100644 --- a/internal/cmd/beta/volume/performance-class/list/list.go +++ b/internal/cmd/beta/volume/performance-class/list/list.go @@ -156,7 +156,7 @@ func outputResult(p *print.Printer, outputFormat string, performanceClasses []ia return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(performanceClasses, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(performanceClasses, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume performance class: %w", err) } diff --git a/internal/cmd/beta/volume/update/update.go b/internal/cmd/beta/volume/update/update.go index 3288062ff..c8a49a617 100644 --- a/internal/cmd/beta/volume/update/update.go +++ b/internal/cmd/beta/volume/update/update.go @@ -163,7 +163,7 @@ func outputResult(p *print.Printer, model *inputModel, volumeLabel string, volum return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(volume, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal volume: %w", err) } diff --git a/internal/cmd/config/list/list.go b/internal/cmd/config/list/list.go index ab5599d7a..7fd7b51ce 100644 --- a/internal/cmd/config/list/list.go +++ b/internal/cmd/config/list/list.go @@ -84,7 +84,7 @@ func outputResult(p *print.Printer, outputFormat string, configData map[string]a p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(configData, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(configData, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal config list: %w", err) } diff --git a/internal/cmd/config/profile/list/list.go b/internal/cmd/config/profile/list/list.go index 98cd68cb7..10f2e239b 100644 --- a/internal/cmd/config/profile/list/list.go +++ b/internal/cmd/config/profile/list/list.go @@ -100,7 +100,7 @@ func outputResult(p *print.Printer, outputFormat string, profiles []profileInfo) p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(profiles, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(profiles, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 3ed23f57d..442a52794 100644 --- a/internal/cmd/dns/record-set/create/create.go +++ b/internal/cmd/dns/record-set/create/create.go @@ -191,7 +191,7 @@ func outputResult(p *print.Printer, model *inputModel, zoneLabel string, resp *d return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 536ff5c64..2a934c8ff 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.MarshalWithOptions(recordSet, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(recordSet, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 3e2bf0f81..2062a7c84 100644 --- a/internal/cmd/dns/record-set/list/list.go +++ b/internal/cmd/dns/record-set/list/list.go @@ -259,7 +259,7 @@ func outputResult(p *print.Printer, outputFormat string, recordSets []dns.Record return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(recordSets, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(recordSets, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal DNS record set list: %w", err) } diff --git a/internal/cmd/dns/zone/clone/clone.go b/internal/cmd/dns/zone/clone/clone.go index e950cdcce..b6d3b3cdb 100644 --- a/internal/cmd/dns/zone/clone/clone.go +++ b/internal/cmd/dns/zone/clone/clone.go @@ -170,7 +170,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal DNS zone: %w", err) } diff --git a/internal/cmd/dns/zone/create/create.go b/internal/cmd/dns/zone/create/create.go index 2ad572f5a..132a9337c 100644 --- a/internal/cmd/dns/zone/create/create.go +++ b/internal/cmd/dns/zone/create/create.go @@ -207,7 +207,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 56308972f..8345bfc15 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.MarshalWithOptions(zone, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(zone, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 7f1bd2a34..73239b2c3 100644 --- a/internal/cmd/dns/zone/list/list.go +++ b/internal/cmd/dns/zone/list/list.go @@ -249,7 +249,7 @@ func outputResult(p *print.Printer, outputFormat string, zones []dns.Zone) error return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(zones, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(zones, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 bd98be64c..0a0ae869e 100644 --- a/internal/cmd/load-balancer/describe/describe.go +++ b/internal/cmd/load-balancer/describe/describe.go @@ -109,7 +109,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancer *loadbalan return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(loadBalancer, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(loadBalancer, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 dde4f20ec..ecd1b4212 100644 --- a/internal/cmd/load-balancer/list/list.go +++ b/internal/cmd/load-balancer/list/list.go @@ -142,7 +142,7 @@ func outputResult(p *print.Printer, outputFormat string, loadBalancers []loadbal return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(loadBalancers, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(loadBalancers, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 26c09bb90..a188bcdd7 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 2fd1bc6e3..68781a17e 100644 --- a/internal/cmd/load-balancer/observability-credentials/describe/describe.go +++ b/internal/cmd/load-balancer/observability-credentials/describe/describe.go @@ -106,7 +106,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials *loadbalanc return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 8ed74da16..bafed9561 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 eb6b3ea21..beecd9db2 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.MarshalWithOptions(quota, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(quota, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 8eeceef88..3ffa3af70 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.MarshalWithOptions(output, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 b21bed0f0..22685cedc 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 2d51fe40b..968c2b3ef 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 cac18139b..a149a6090 100644 --- a/internal/cmd/logme/credentials/list/list.go +++ b/internal/cmd/logme/credentials/list/list.go @@ -146,7 +146,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []logme.Cre return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 d77f9f64e..7effe9a74 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 896f42982..9a19a4a9c 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e8784d054..593aff6da 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 6177a4143..385ee2639 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.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 404d5e8a9..8fd77e4c1 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal MariaDB credentials list: %w", err) } diff --git a/internal/cmd/mariadb/credentials/describe/describe.go b/internal/cmd/mariadb/credentials/describe/describe.go index 31a09a17e..8739c7d59 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 47e15f379..b854d6c66 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 031ef8930..81732c1a6 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 49788795c..952754762 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f360462d3..37c5afff4 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 6d6053c21..bd3d31957 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.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 4d2d9d108..b675b69ee 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.MarshalWithOptions(backup, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 9f19d9c3c..1b251571a 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.MarshalWithOptions(backups, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e77538fd3..30a48be34 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.MarshalWithOptions(restoreJobs, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(restoreJobs, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e4b0cbb75..9445055a6 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.MarshalWithOptions(output, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f4882ab95..d601a92a9 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 bac7b7205..ca4858da5 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 40ac2ef8d..5b65f8d5e 100644 --- a/internal/cmd/mongodbflex/instance/list/list.go +++ b/internal/cmd/mongodbflex/instance/list/list.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []mongodbflex return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 bc3dba632..68f2f85ba 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 abe1cca69..1b869a5c1 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.MarshalWithOptions(options, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f3744c3cb..cd383eac2 100644 --- a/internal/cmd/mongodbflex/user/create/create.go +++ b/internal/cmd/mongodbflex/user/create/create.go @@ -160,7 +160,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, use return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 5f95804a3..b94f4b453 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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 365f5ee36..ae690568b 100644 --- a/internal/cmd/mongodbflex/user/list/list.go +++ b/internal/cmd/mongodbflex/user/list/list.go @@ -149,7 +149,7 @@ func outputResult(p *print.Printer, outputFormat string, users []mongodbflex.Lis return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e04fa7b90..f35c252f3 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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 9e030b954..c1b8fe50c 100644 --- a/internal/cmd/object-storage/bucket/create/create.go +++ b/internal/cmd/object-storage/bucket/create/create.go @@ -137,7 +137,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *objectstorage.Creat return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f23a2fc85..1f2912a5f 100644 --- a/internal/cmd/object-storage/bucket/describe/describe.go +++ b/internal/cmd/object-storage/bucket/describe/describe.go @@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, bucket *objectstorage.B return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(bucket, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(bucket, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 d9409ff45..ffde74c04 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.MarshalWithOptions(buckets, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(buckets, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 9a611b5b3..01bb89ac0 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 7f2962c23..c2c2028be 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.MarshalWithOptions(credentialsGroups, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentialsGroups, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 1e659cdb7..662f02937 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 237d74c61..181f43371 100644 --- a/internal/cmd/object-storage/credentials/list/list.go +++ b/internal/cmd/object-storage/credentials/list/list.go @@ -147,7 +147,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []objectsto return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Object Storage credentials list: %w", err) } diff --git a/internal/cmd/observability/credentials/create/create.go b/internal/cmd/observability/credentials/create/create.go index 6ee744588..b965364a3 100644 --- a/internal/cmd/observability/credentials/create/create.go +++ b/internal/cmd/observability/credentials/create/create.go @@ -121,7 +121,7 @@ func outputResult(p *print.Printer, model *inputModel, instanceLabel string, res return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability credentials: %w", err) } diff --git a/internal/cmd/observability/credentials/list/list.go b/internal/cmd/observability/credentials/list/list.go index 397f1c6a9..9c9452832 100644 --- a/internal/cmd/observability/credentials/list/list.go +++ b/internal/cmd/observability/credentials/list/list.go @@ -135,7 +135,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []observabi return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability credentials list: %w", err) } diff --git a/internal/cmd/observability/grafana/describe/describe.go b/internal/cmd/observability/grafana/describe/describe.go index 9c50a7c6a..245a4b8b4 100644 --- a/internal/cmd/observability/grafana/describe/describe.go +++ b/internal/cmd/observability/grafana/describe/describe.go @@ -135,7 +135,7 @@ func outputResult(p *print.Printer, inputModel *inputModel, grafanaConfigs *obse return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(grafanaConfigs, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(grafanaConfigs, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Grafana configs: %w", err) } diff --git a/internal/cmd/observability/instance/create/create.go b/internal/cmd/observability/instance/create/create.go index 134b8388e..99b7fe5f2 100644 --- a/internal/cmd/observability/instance/create/create.go +++ b/internal/cmd/observability/instance/create/create.go @@ -211,7 +211,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability instance: %w", err) } diff --git a/internal/cmd/observability/instance/describe/describe.go b/internal/cmd/observability/instance/describe/describe.go index dfd0717c7..3b4a62e40 100644 --- a/internal/cmd/observability/instance/describe/describe.go +++ b/internal/cmd/observability/instance/describe/describe.go @@ -108,7 +108,7 @@ func outputResult(p *print.Printer, outputFormat string, instance *observability return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability instance: %w", err) } diff --git a/internal/cmd/observability/instance/list/list.go b/internal/cmd/observability/instance/list/list.go index db212da21..b540bee32 100644 --- a/internal/cmd/observability/instance/list/list.go +++ b/internal/cmd/observability/instance/list/list.go @@ -140,7 +140,7 @@ func outputResult(p *print.Printer, outputFormat string, instances []observabili return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability instance list: %w", err) } diff --git a/internal/cmd/observability/plans/plans.go b/internal/cmd/observability/plans/plans.go index 872d5efea..d42cfb8a0 100644 --- a/internal/cmd/observability/plans/plans.go +++ b/internal/cmd/observability/plans/plans.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []observability.P return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal Observability plans: %w", err) } diff --git a/internal/cmd/observability/scrape-config/describe/describe.go b/internal/cmd/observability/scrape-config/describe/describe.go index 37dd359e7..7e92bd58f 100644 --- a/internal/cmd/observability/scrape-config/describe/describe.go +++ b/internal/cmd/observability/scrape-config/describe/describe.go @@ -110,7 +110,7 @@ func outputResult(p *print.Printer, outputFormat string, config *observability.J return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(config, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(config, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal scrape configuration: %w", err) } diff --git a/internal/cmd/observability/scrape-config/list/list.go b/internal/cmd/observability/scrape-config/list/list.go index 6e2543869..5dbdde095 100644 --- a/internal/cmd/observability/scrape-config/list/list.go +++ b/internal/cmd/observability/scrape-config/list/list.go @@ -138,7 +138,7 @@ func outputResult(p *print.Printer, outputFormat string, configs []observability return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(configs, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(configs, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal scrape configurations list: %w", err) } diff --git a/internal/cmd/opensearch/credentials/create/create.go b/internal/cmd/opensearch/credentials/create/create.go index 015c41cc9..b2e4dde55 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 838521396..64817d66a 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 7f5636691..b58c99796 100644 --- a/internal/cmd/opensearch/credentials/list/list.go +++ b/internal/cmd/opensearch/credentials/list/list.go @@ -146,7 +146,7 @@ func outputResult(p *print.Printer, outputFormat string, credentials []opensearc return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 b287e54e8..d6eeaf951 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 8fd2f081b..fffdc1f86 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 c53fa0176..024619beb 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f72dc67a1..50be3aae8 100644 --- a/internal/cmd/opensearch/plans/plans.go +++ b/internal/cmd/opensearch/plans/plans.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []opensearch.Offe return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 3a4c38a41..65f38a490 100644 --- a/internal/cmd/organization/member/list/list.go +++ b/internal/cmd/organization/member/list/list.go @@ -168,7 +168,7 @@ func outputResult(p *print.Printer, model *inputModel, members []authorization.M return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 51e9390af..5818142ff 100644 --- a/internal/cmd/organization/role/list/list.go +++ b/internal/cmd/organization/role/list/list.go @@ -141,7 +141,7 @@ func outputRolesResult(p *print.Printer, outputFormat string, roles []authorizat return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 10c3bdda8..80cae356a 100644 --- a/internal/cmd/postgresflex/backup/describe/describe.go +++ b/internal/cmd/postgresflex/backup/describe/describe.go @@ -123,7 +123,7 @@ func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat string, bac return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 c03a3afb6..a8416f602 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.MarshalWithOptions(backups, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 b9d10e78b..4ca79de4b 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 5fb8b931c..062107375 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 404a1c23d..c65ebfda1 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 349f7d872..aa0e92a03 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 975c7c860..c5f1857f6 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 22950039d..d21067aa1 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.MarshalWithOptions(options, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f8d65bf01..4638da73d 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 b63e08bd7..896154984 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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 ae76e7958..bf540ad4c 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.MarshalWithOptions(users, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 35d097168..60abaf04a 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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 bb67f8cf1..19d20beed 100644 --- a/internal/cmd/project/create/create.go +++ b/internal/cmd/project/create/create.go @@ -223,7 +223,7 @@ func outputResult(p *print.Printer, model *inputModel, resp *resourcemanager.Pro return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 a9d948e67..62b997b64 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.MarshalWithOptions(project, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 8c9bb0d8e..99afb9b1f 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.MarshalWithOptions(projects, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(projects, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 a95a95fbe..1d5056303 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.MarshalWithOptions(members, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 991a00665..4b98bf977 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.MarshalWithOptions(roles, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 2b73dd453..1a7cd75ad 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 178027280..990fcad69 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 6911f04c7..e9b03d199 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 d4c970321..2810d24e8 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e5038f212..2aad472cd 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 a371d0f68..3ffc1a146 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 7255baae7..6156c0724 100644 --- a/internal/cmd/rabbitmq/plans/plans.go +++ b/internal/cmd/rabbitmq/plans/plans.go @@ -141,7 +141,7 @@ func outputResult(p *print.Printer, outputFormat string, plans []rabbitmq.Offeri return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e241a2d27..388e269a4 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 238b67bc5..6d342002f 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 78be560f1..a83492451 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.MarshalWithOptions(credentials, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 eec468709..84d8e19ee 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 1b41c20d4..5e8737212 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.MarshalWithOptions(instance, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 2eff0bf8c..d75ea93b4 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 ef94c2a12..0f7dbde6b 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.MarshalWithOptions(plans, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 016a4326e..3d16d252e 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 416717ef1..e40278256 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.MarshalWithOptions(output, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 a207cc98d..019aff8f6 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.MarshalWithOptions(instances, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 6143b7d98..33edfbe3a 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 f93e19a24..2bfb18b08 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.MarshalWithOptions(user, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 ad0bc0e67..19ff7f8ea 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.MarshalWithOptions(users, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 3faec270c..390e5a15b 100644 --- a/internal/cmd/service-account/create/create.go +++ b/internal/cmd/service-account/create/create.go @@ -130,7 +130,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, serv return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(serviceAccount, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serviceAccount, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 13040757d..66c7fafcb 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.MarshalWithOptions(keys, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(keys, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e3e6f3b83..c4ea786d2 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.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 12e0ce6fa..19a52faee 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.MarshalWithOptions(token, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(token, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 e9395d668..48b793f42 100644 --- a/internal/cmd/service-account/token/list/list.go +++ b/internal/cmd/service-account/token/list/list.go @@ -155,7 +155,7 @@ func outputResult(p *print.Printer, outputFormat string, tokensMetadata []servic return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(tokensMetadata, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(tokensMetadata, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 cb5981d52..967b1fe37 100644 --- a/internal/cmd/ske/cluster/create/create.go +++ b/internal/cmd/ske/cluster/create/create.go @@ -208,7 +208,7 @@ func outputResult(p *print.Printer, model *inputModel, projectLabel string, resp return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 5a4b4ec0e..9740abf39 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.MarshalWithOptions(cluster, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(cluster, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 785f645c1..0a39805aa 100644 --- a/internal/cmd/ske/cluster/list/list.go +++ b/internal/cmd/ske/cluster/list/list.go @@ -158,7 +158,7 @@ func outputResult(p *print.Printer, outputFormat string, clusters []ske.Cluster) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(clusters, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(clusters, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 491daf86e..48d73784b 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.MarshalWithOptions(resp, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SKE cluster: %w", err) } diff --git a/internal/cmd/ske/describe/describe.go b/internal/cmd/ske/describe/describe.go index 53d9dd848..025cd78a1 100644 --- a/internal/cmd/ske/describe/describe.go +++ b/internal/cmd/ske/describe/describe.go @@ -97,7 +97,7 @@ func outputResult(p *print.Printer, outputFormat string, project *serviceenablem return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) 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 adc74b0e5..a8fb68437 100644 --- a/internal/cmd/ske/kubeconfig/create/create.go +++ b/internal/cmd/ske/kubeconfig/create/create.go @@ -262,9 +262,9 @@ func outputResult(p *print.Printer, model *inputModel, kubeconfigPath string, re var err error var details []byte if respKubeconfig != nil { - details, err = yaml.MarshalWithOptions(respKubeconfig, yaml.IndentSequence(true)) + details, err = yaml.MarshalWithOptions(respKubeconfig, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) } else if respLogin != nil { - details, err = yaml.MarshalWithOptions(respLogin, yaml.IndentSequence(true)) + details, err = yaml.MarshalWithOptions(respLogin, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) } 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 e8ad07eea..82105321c 100644 --- a/internal/cmd/ske/options/options.go +++ b/internal/cmd/ske/options/options.go @@ -166,7 +166,7 @@ func outputResult(p *print.Printer, model *inputModel, options *ske.ProviderOpti p.Outputln(string(details)) return nil case print.YAMLOutputFormat: - details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) + details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true), yaml.UseJSONMarshaler()) if err != nil { return fmt.Errorf("marshal SKE options: %w", err) }