@@ -19,16 +19,16 @@ package cmd
19
19
import (
20
20
"context"
21
21
"fmt"
22
+ "path"
23
+
22
24
"github.com/chaosblade-io/chaosblade-exec-cri/exec"
23
25
"github.com/chaosblade-io/chaosblade-operator/exec/model"
24
26
"github.com/chaosblade-io/chaosblade-spec-go/log"
25
- "github.com/chaosblade-io/chaosblade/exec/middleware"
26
27
"github.com/chaosblade-io/chaosblade/exec/cloud"
27
- "path "
28
+ "github.com/chaosblade-io/chaosblade/exec/middleware "
28
29
29
30
"github.com/chaosblade-io/chaosblade-spec-go/channel"
30
31
"github.com/chaosblade-io/chaosblade-spec-go/spec"
31
- "github.com/chaosblade-io/chaosblade-spec-go/util"
32
32
specutil "github.com/chaosblade-io/chaosblade-spec-go/util"
33
33
"github.com/spf13/cobra"
34
34
"github.com/spf13/pflag"
@@ -137,7 +137,7 @@ func (ec *baseExpCommandService) registerSubCommands() {
137
137
138
138
// registerOsExpCommands
139
139
func (ec * baseExpCommandService ) registerOsExpCommands () []* modelCommand {
140
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-os-spec-%s.yaml" , version .Ver ))
140
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-os-spec-%s.yaml" , version .Ver ))
141
141
models , err := specutil .ParseSpecsToModel (file , os .NewExecutor ())
142
142
if err != nil {
143
143
return nil
@@ -151,10 +151,9 @@ func (ec *baseExpCommandService) registerOsExpCommands() []*modelCommand {
151
151
return osCommands
152
152
}
153
153
154
-
155
154
// registerMiddlewareExpCommands
156
155
func (ec * baseExpCommandService ) registerMiddlewareExpCommands () []* modelCommand {
157
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-middleware-spec-%s.yaml" , version .Ver ))
156
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-middleware-spec-%s.yaml" , version .Ver ))
158
157
models , err := specutil .ParseSpecsToModel (file , middleware .NewExecutor ())
159
158
if err != nil {
160
159
return nil
@@ -167,9 +166,10 @@ func (ec *baseExpCommandService) registerMiddlewareExpCommands() []*modelCommand
167
166
}
168
167
return middlewareCommands
169
168
}
169
+
170
170
// registerCloudExpCommands
171
171
func (ec * baseExpCommandService ) registerCloudExpCommands () []* modelCommand {
172
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-cloud-spec-%s.yaml" , version .Ver ))
172
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-cloud-spec-%s.yaml" , version .Ver ))
173
173
models , err := specutil .ParseSpecsToModel (file , cloud .NewExecutor ())
174
174
if err != nil {
175
175
return nil
@@ -186,8 +186,8 @@ func (ec *baseExpCommandService) registerCloudExpCommands() []*modelCommand {
186
186
187
187
// registerJvmExpCommands
188
188
func (ec * baseExpCommandService ) registerJvmExpCommands () []* modelCommand {
189
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
190
- models , err := util .ParseSpecsToModel (file , jvm .NewExecutor ())
189
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
190
+ models , err := specutil .ParseSpecsToModel (file , jvm .NewExecutor ())
191
191
if err != nil {
192
192
return nil
193
193
}
@@ -202,8 +202,8 @@ func (ec *baseExpCommandService) registerJvmExpCommands() []*modelCommand {
202
202
203
203
// registerCplusExpCommands
204
204
func (ec * baseExpCommandService ) registerCplusExpCommands () []* modelCommand {
205
- file := path .Join (util .GetYamlHome (), "chaosblade-cplus-spec.yaml" )
206
- models , err := util .ParseSpecsToModel (file , cplus .NewExecutor ())
205
+ file := path .Join (specutil .GetYamlHome (), "chaosblade-cplus-spec.yaml" )
206
+ models , err := specutil .ParseSpecsToModel (file , cplus .NewExecutor ())
207
207
if err != nil {
208
208
return nil
209
209
}
@@ -218,7 +218,7 @@ func (ec *baseExpCommandService) registerCplusExpCommands() []*modelCommand {
218
218
219
219
// registerDockerExpCommands
220
220
func (ec * baseExpCommandService ) registerDockerExpCommands () []* modelCommand {
221
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-docker-spec-%s.yaml" , version .Ver ))
221
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-docker-spec-%s.yaml" , version .Ver ))
222
222
models , err := specutil .ParseSpecsToModel (file , docker .NewExecutor ())
223
223
if err != nil {
224
224
return nil
@@ -231,8 +231,8 @@ func (ec *baseExpCommandService) registerDockerExpCommands() []*modelCommand {
231
231
modelCommands = append (modelCommands , command )
232
232
}
233
233
234
- file = path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
235
- models , err = util .ParseSpecsToModel (file , docker .NewExecutor ())
234
+ file = path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
235
+ models , err = specutil .ParseSpecsToModel (file , docker .NewExecutor ())
236
236
if err != nil {
237
237
return nil
238
238
}
@@ -262,7 +262,7 @@ func GetResourceFlags() []spec.ExpFlagSpec {
262
262
263
263
func (ec * baseExpCommandService ) registerK8sExpCommands () []* modelCommand {
264
264
// 读取 k8s 下的场景并注册
265
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-k8s-spec-%s.yaml" , version .Ver ))
265
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-k8s-spec-%s.yaml" , version .Ver ))
266
266
models , err := specutil .ParseSpecsToModel (file , kubernetes .NewComposeExecutor ())
267
267
if err != nil {
268
268
return nil
@@ -275,8 +275,8 @@ func (ec *baseExpCommandService) registerK8sExpCommands() []*modelCommand {
275
275
modelCommands = append (modelCommands , command )
276
276
}
277
277
278
- file = path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
279
- models , err = util .ParseSpecsToModel (file , kubernetes .NewExecutor ())
278
+ file = path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
279
+ models , err = specutil .ParseSpecsToModel (file , kubernetes .NewExecutor ())
280
280
if err != nil {
281
281
return nil
282
282
}
@@ -299,7 +299,7 @@ func (ec *baseExpCommandService) registerK8sExpCommands() []*modelCommand {
299
299
300
300
// registerCriExpCommands
301
301
func (ec * baseExpCommandService ) registerCriExpCommands () []* modelCommand {
302
- file := path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-cri-spec-%s.yaml" , version .Ver ))
302
+ file := path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-cri-spec-%s.yaml" , version .Ver ))
303
303
models , err := specutil .ParseSpecsToModel (file , cri .NewExecutor ())
304
304
if err != nil {
305
305
return nil
@@ -312,8 +312,8 @@ func (ec *baseExpCommandService) registerCriExpCommands() []*modelCommand {
312
312
modelCommands = append (modelCommands , command )
313
313
}
314
314
315
- file = path .Join (util .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
316
- models , err = util .ParseSpecsToModel (file , cri .NewExecutor ())
315
+ file = path .Join (specutil .GetYamlHome (), fmt .Sprintf ("chaosblade-jvm-spec-%s.yaml" , version .Ver ))
316
+ models , err = specutil .ParseSpecsToModel (file , cri .NewExecutor ())
317
317
if err != nil {
318
318
return nil
319
319
}
0 commit comments