Skip to content

Commit 14dd583

Browse files
committed
use yaml base64 converting function
1 parent f116710 commit 14dd583

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

internal/cmd/server/describe/describe.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/stackitcloud/stackit-cli/internal/pkg/tables"
1717
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
1818

19-
"github.com/goccy/go-yaml"
2019
"github.com/spf13/cobra"
2120
"github.com/stackitcloud/stackit-sdk-go/services/iaas"
2221
)
@@ -118,7 +117,7 @@ func outputResult(p *print.Printer, outputFormat string, server *iaas.Server) er
118117

119118
return nil
120119
case print.YAMLOutputFormat:
121-
details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
120+
details, err := utils.MarshalToYAMLWithBase64Bytes(server)
122121
if err != nil {
123122
return fmt.Errorf("marshal server: %w", err)
124123
}

internal/cmd/server/list/list.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/stackitcloud/stackit-cli/internal/pkg/tables"
1818
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
1919

20-
"github.com/goccy/go-yaml"
2120
"github.com/spf13/cobra"
2221
"github.com/stackitcloud/stackit-sdk-go/services/iaas"
2322
)
@@ -158,9 +157,9 @@ func outputResult(p *print.Printer, outputFormat string, servers []iaas.Server)
158157

159158
return nil
160159
case print.YAMLOutputFormat:
161-
details, err := yaml.MarshalWithOptions(servers, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
160+
details, err := utils.MarshalToYAMLWithBase64Bytes(servers)
162161
if err != nil {
163-
return fmt.Errorf("marshal server: %w", err)
162+
return fmt.Errorf("marshal servers: %w", err)
164163
}
165164
p.Outputln(string(details))
166165

0 commit comments

Comments
 (0)