mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-10 12:44:16 +00:00
refactor(grpc-proxy): use Metadata.Err() method to get upstream error for a broadcasted request
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ func list(ctx context.Context, uncli *cli.CLI, opts listOptions) error {
|
||||
var rows []imageRow
|
||||
|
||||
for _, machineImages := range clusterImages {
|
||||
if err := machineImages.Error(); err != nil {
|
||||
if err := machineImages.Metadata.Err(); err != nil {
|
||||
tui.PrintWarning(fmt.Sprintf("failed to list images on machine '%s': %s",
|
||||
machineImages.Metadata.MachineName, err))
|
||||
continue
|
||||
|
||||
@@ -54,8 +54,8 @@ func rtt(ctx context.Context, uncli *cli.CLI) error {
|
||||
tui.PrintWarning("metadata is missing in response from unknown server")
|
||||
continue
|
||||
}
|
||||
if m.Metadata.Error != "" {
|
||||
tui.PrintWarning(fmt.Sprintf("failed to inspect machine '%s': %s", m.Metadata.MachineName, m.Metadata.Error))
|
||||
if err := m.Metadata.Err(); err != nil {
|
||||
tui.PrintWarning(fmt.Sprintf("failed to inspect machine '%s': %s", m.Metadata.MachineName, err))
|
||||
continue
|
||||
}
|
||||
if m.Machine == nil {
|
||||
|
||||
+2
-2
@@ -207,9 +207,9 @@ func collectContainers(ctx context.Context, cli *client.Client) ([]containerInfo
|
||||
|
||||
machineName := msc.Metadata.MachineName
|
||||
|
||||
if msc.Metadata.Error != "" {
|
||||
if err := msc.Metadata.Err(); err != nil {
|
||||
tui.PrintWarning(fmt.Sprintf("failed to list service containers on machine %s: %s",
|
||||
machineName, msc.Metadata.Error))
|
||||
machineName, err))
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user