Skip to content

Commit 405dc5c

Browse files
committed
use base64 convertion in server describe and list
1 parent 405fc2f commit 405dc5c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/cmd/server/describe/describe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func outputResult(p *print.Printer, outputFormat string, server *iaas.Server) er
118118

119119
return nil
120120
case print.YAMLOutputFormat:
121-
details, err := yaml.MarshalWithOptions(server, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
121+
patchedServer := utils.ConvertToBase64PatchedServer(server)
122+
details, err := yaml.MarshalWithOptions(patchedServer, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
122123
if err != nil {
123124
return fmt.Errorf("marshal server: %w", err)
124125
}

internal/cmd/server/list/list.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ func outputResult(p *print.Printer, outputFormat string, servers []iaas.Server)
158158

159159
return nil
160160
case print.YAMLOutputFormat:
161-
details, err := yaml.MarshalWithOptions(servers, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
161+
patchedServers := utils.ConvertToBase64PatchedServers(servers)
162+
details, err := yaml.MarshalWithOptions(patchedServers, yaml.IndentSequence(true), yaml.UseJSONMarshaler())
162163
if err != nil {
163164
return fmt.Errorf("marshal server: %w", err)
164165
}

0 commit comments

Comments
 (0)