@@ -8,10 +8,10 @@ import (
88 "github.com/docker/infrakit/cmd/cli/base"
99 "github.com/docker/infrakit/pkg/discovery"
1010 logutil "github.com/docker/infrakit/pkg/log"
11- metadata_plugin "github.com/docker/infrakit/pkg/plugin/metadata"
1211 "github.com/docker/infrakit/pkg/rpc/client"
1312 metadata_rpc "github.com/docker/infrakit/pkg/rpc/metadata"
1413 "github.com/docker/infrakit/pkg/spi/metadata"
14+ "github.com/docker/infrakit/pkg/types"
1515 "github.com/spf13/cobra"
1616)
1717
@@ -48,17 +48,17 @@ func forPlugin(plugins func() discovery.Plugins, do func(string, metadata.Plugin
4848 return nil
4949}
5050
51- func listAll (m metadata.Plugin , path metadata .Path ) ([]metadata .Path , error ) {
51+ func listAll (m metadata.Plugin , path types .Path ) ([]types .Path , error ) {
5252 if m == nil {
5353 return nil , fmt .Errorf ("no plugin" )
5454 }
55- result := []metadata .Path {}
55+ result := []types .Path {}
5656 nodes , err := m .List (path )
5757 if err != nil {
5858 return nil , err
5959 }
6060 for _ , n := range nodes {
61- c := path .Join (n )
61+ c := path .JoinString (n )
6262 more , err := listAll (m , c )
6363 if err != nil {
6464 return nil , err
@@ -110,7 +110,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
110110 return fmt .Errorf ("No absolute path" )
111111 }
112112
113- path := metadata_plugin . Path (p )
113+ path := types . PathFromString (p )
114114 first := path .Index (0 )
115115
116116 targets := []string {} // target plugins to query
@@ -128,7 +128,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
128128
129129 for j , target := range targets {
130130
131- nodes := []metadata .Path {} // the result set to print
131+ nodes := []types .Path {} // the result set to print
132132
133133 match , err := getPlugin (plugins , target )
134134 if err != nil {
@@ -142,11 +142,11 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
142142 log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
143143 }
144144 for _ , c := range allPaths {
145- nodes = append (nodes , metadata_plugin . Path (target ).Sub (c ))
145+ nodes = append (nodes , types . PathFromString (target ).Join (c ))
146146 }
147147 } else {
148148 for _ , t := range targets {
149- nodes = append (nodes , metadata_plugin . Path (t ))
149+ nodes = append (nodes , types . PathFromString (t ))
150150 }
151151 }
152152
@@ -157,15 +157,15 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
157157 log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
158158 }
159159 for _ , c := range allPaths {
160- nodes = append (nodes , metadata_plugin . Path (target ).Sub (c ))
160+ nodes = append (nodes , types . PathFromString (target ).Join (c ))
161161 }
162162 } else {
163163 children , err := match .List (path .Shift (1 ))
164164 if err != nil {
165165 log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
166166 }
167167 for _ , c := range children {
168- nodes = append (nodes , path .Join (c ))
168+ nodes = append (nodes , path .JoinString (c ))
169169 }
170170 }
171171 }
@@ -177,9 +177,9 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
177177 }
178178 for _ , l := range nodes {
179179 if * long {
180- fmt .Println (metadata_plugin . String ( l ) )
180+ fmt .Println (l )
181181 } else {
182- fmt .Println (metadata_plugin . String ( l .Rel (path ) ))
182+ fmt .Println (l .Rel (path ))
183183 }
184184 }
185185 break
@@ -196,9 +196,9 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
196196 }
197197 for _ , l := range nodes {
198198 if * long {
199- fmt .Println (metadata_plugin . String ( l ) )
199+ fmt .Println (l )
200200 } else {
201- fmt .Println (metadata_plugin . String ( l .Rel (path ) ))
201+ fmt .Println (l .Rel (path ))
202202 }
203203 }
204204 }
@@ -215,7 +215,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
215215
216216 for _ , p := range args {
217217
218- path := metadata_plugin . Path (p )
218+ path := types . PathFromString (p )
219219 first := path .Index (0 )
220220 if first != nil {
221221 match , err := getPlugin (plugins , * first )
0 commit comments