gRPC migration update
Change-Id: Icdd1a824948fa994cd36bd121c962f5ecf74e3cf
diff --git a/internal/pkg/commands/adapter.go b/internal/pkg/commands/adapter.go
index 73b91e1..b299a8e 100644
--- a/internal/pkg/commands/adapter.go
+++ b/internal/pkg/commands/adapter.go
@@ -21,11 +21,12 @@
"github.com/golang/protobuf/ptypes/empty"
flags "github.com/jessevdk/go-flags"
"github.com/opencord/voltctl/pkg/format"
- "github.com/opencord/voltha-protos/v4/go/voltha"
+ "github.com/opencord/voltctl/pkg/model"
+ "github.com/opencord/voltha-protos/v5/go/voltha"
)
const (
- DEFAULT_OUTPUT_FORMAT = "table{{ .Id }}\t{{ .Vendor }}\t{{ .Type }}\t{{ .Endpoint }}\t{{ .Version }}\t{{ .CurrentReplica }}\t{{ .TotalReplicas }}\t{{ since .LastCommunication}}"
+ DEFAULT_OUTPUT_FORMAT = "table{{ .Id }}\t{{ .Vendor }}\t{{ .Type }}\t{{ .Endpoint }}\t{{ .Version }}\t{{ .CurrentReplica }}\t{{ .TotalReplicas }}\t{{ gosince .LastCommunication}}"
)
type AdapterList struct {
@@ -60,6 +61,10 @@
if err != nil {
return err
}
+ data := make([]model.AdapterInstance, len(adapters.Items))
+ for i, item := range adapters.Items {
+ data[i].PopulateFrom(item)
+ }
outputFormat := CharReplacer.Replace(options.Format)
if outputFormat == "" {
@@ -82,7 +87,7 @@
OrderBy: orderBy,
OutputAs: toOutputType(options.OutputAs),
NameLimit: options.NameLimit,
- Data: adapters.Items,
+ Data: data,
}
GenerateOutput(&result)