@@ -8,10 +8,10 @@ import (
8
8
"github.com/docker/infrakit/cmd/cli/base"
9
9
"github.com/docker/infrakit/pkg/discovery"
10
10
logutil "github.com/docker/infrakit/pkg/log"
11
- metadata_plugin "github.com/docker/infrakit/pkg/plugin/metadata"
12
11
"github.com/docker/infrakit/pkg/rpc/client"
13
12
metadata_rpc "github.com/docker/infrakit/pkg/rpc/metadata"
14
13
"github.com/docker/infrakit/pkg/spi/metadata"
14
+ "github.com/docker/infrakit/pkg/types"
15
15
"github.com/spf13/cobra"
16
16
)
17
17
@@ -48,17 +48,17 @@ func forPlugin(plugins func() discovery.Plugins, do func(string, metadata.Plugin
48
48
return nil
49
49
}
50
50
51
- func listAll (m metadata.Plugin , path metadata .Path ) ([]metadata .Path , error ) {
51
+ func listAll (m metadata.Plugin , path types .Path ) ([]types .Path , error ) {
52
52
if m == nil {
53
53
return nil , fmt .Errorf ("no plugin" )
54
54
}
55
- result := []metadata .Path {}
55
+ result := []types .Path {}
56
56
nodes , err := m .List (path )
57
57
if err != nil {
58
58
return nil , err
59
59
}
60
60
for _ , n := range nodes {
61
- c := path .Join (n )
61
+ c := path .JoinString (n )
62
62
more , err := listAll (m , c )
63
63
if err != nil {
64
64
return nil , err
@@ -110,7 +110,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
110
110
return fmt .Errorf ("No absolute path" )
111
111
}
112
112
113
- path := metadata_plugin . Path (p )
113
+ path := types . PathFromString (p )
114
114
first := path .Index (0 )
115
115
116
116
targets := []string {} // target plugins to query
@@ -128,7 +128,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
128
128
129
129
for j , target := range targets {
130
130
131
- nodes := []metadata .Path {} // the result set to print
131
+ nodes := []types .Path {} // the result set to print
132
132
133
133
match , err := getPlugin (plugins , target )
134
134
if err != nil {
@@ -142,11 +142,11 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
142
142
log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
143
143
}
144
144
for _ , c := range allPaths {
145
- nodes = append (nodes , metadata_plugin . Path (target ).Sub (c ))
145
+ nodes = append (nodes , types . PathFromString (target ).Join (c ))
146
146
}
147
147
} else {
148
148
for _ , t := range targets {
149
- nodes = append (nodes , metadata_plugin . Path (t ))
149
+ nodes = append (nodes , types . PathFromString (t ))
150
150
}
151
151
}
152
152
@@ -157,15 +157,15 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
157
157
log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
158
158
}
159
159
for _ , c := range allPaths {
160
- nodes = append (nodes , metadata_plugin . Path (target ).Sub (c ))
160
+ nodes = append (nodes , types . PathFromString (target ).Join (c ))
161
161
}
162
162
} else {
163
163
children , err := match .List (path .Shift (1 ))
164
164
if err != nil {
165
165
log .Warn ("Cannot metadata ls on plugin" , "target" , target , "err" , err )
166
166
}
167
167
for _ , c := range children {
168
- nodes = append (nodes , path .Join (c ))
168
+ nodes = append (nodes , path .JoinString (c ))
169
169
}
170
170
}
171
171
}
@@ -177,9 +177,9 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
177
177
}
178
178
for _ , l := range nodes {
179
179
if * long {
180
- fmt .Println (metadata_plugin . String ( l ) )
180
+ fmt .Println (l )
181
181
} else {
182
- fmt .Println (metadata_plugin . String ( l .Rel (path ) ))
182
+ fmt .Println (l .Rel (path ))
183
183
}
184
184
}
185
185
break
@@ -196,9 +196,9 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
196
196
}
197
197
for _ , l := range nodes {
198
198
if * long {
199
- fmt .Println (metadata_plugin . String ( l ) )
199
+ fmt .Println (l )
200
200
} else {
201
- fmt .Println (metadata_plugin . String ( l .Rel (path ) ))
201
+ fmt .Println (l .Rel (path ))
202
202
}
203
203
}
204
204
}
@@ -215,7 +215,7 @@ func Command(plugins func() discovery.Plugins) *cobra.Command {
215
215
216
216
for _ , p := range args {
217
217
218
- path := metadata_plugin . Path (p )
218
+ path := types . PathFromString (p )
219
219
first := path .Index (0 )
220
220
if first != nil {
221
221
match , err := getPlugin (plugins , * first )
0 commit comments