This repository was archived by the owner on Oct 10, 2023. It is now read-only.
File tree 3 files changed +33
-5
lines changed
3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 7
7
"fmt"
8
8
"strings"
9
9
10
+ "github.com/aunum/log"
11
+
10
12
"github.com/pkg/errors"
11
13
"github.com/spf13/cobra"
12
14
@@ -129,6 +131,7 @@ var addDiscoverySourceCmd = &cobra.Command{
129
131
if err != nil {
130
132
return err
131
133
}
134
+ log .Successf ("successfully added discovery source %s" , discoverySourceName )
132
135
return nil
133
136
},
134
137
}
@@ -175,6 +178,7 @@ var updateDiscoverySourceCmd = &cobra.Command{
175
178
if err != nil {
176
179
return err
177
180
}
181
+ log .Successf ("updated discovery source %s" , discoveryName )
178
182
return nil
179
183
},
180
184
}
@@ -211,6 +215,7 @@ var deleteDiscoverySourceCmd = &cobra.Command{
211
215
if err != nil {
212
216
return err
213
217
}
218
+ log .Successf ("deleted discovery source %s" , discoveryName )
214
219
return nil
215
220
},
216
221
}
Original file line number Diff line number Diff line change @@ -366,7 +366,11 @@ var upgradePluginCmd = &cobra.Command{
366
366
367
367
versionSelector := repo .VersionSelector ()
368
368
err = cli .UpgradePlugin (pluginName , plugin .FindVersion (versionSelector ), repo )
369
- return
369
+ if err != nil {
370
+ return err
371
+ }
372
+ log .Successf ("successfully upgraded plugin %s" , pluginName )
373
+ return nil
370
374
},
371
375
}
372
376
@@ -402,8 +406,11 @@ var deletePluginCmd = &cobra.Command{
402
406
}
403
407
404
408
err = cli .DeletePlugin (pluginName )
405
-
406
- return
409
+ if err != nil {
410
+ return err
411
+ }
412
+ log .Successf ("successfully deleted plugin %s" , pluginName )
413
+ return nil
407
414
},
408
415
}
409
416
@@ -412,9 +419,20 @@ var cleanPluginCmd = &cobra.Command{
412
419
Short : "Clean the plugins" ,
413
420
RunE : func (cmd * cobra.Command , args []string ) (err error ) {
414
421
if config .IsFeatureActivated (config .FeatureContextAwareCLIForPlugins ) {
415
- return pluginmanager .Clean ()
422
+ err = pluginmanager .Clean ()
423
+ if err != nil {
424
+ return err
425
+ }
426
+ log .Success ("successfully cleaned up all plugins" )
427
+ return nil
416
428
}
417
- return cli .Clean ()
429
+
430
+ err = cli .Clean ()
431
+ if err != nil {
432
+ return err
433
+ }
434
+ log .Success ("successfully cleaned up all plugins" )
435
+ return nil
418
436
},
419
437
}
420
438
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ package command
6
6
import (
7
7
"fmt"
8
8
9
+ "github.com/aunum/log"
10
+
9
11
"github.com/spf13/cobra"
10
12
11
13
configv1alpha1 "github.com/vmware-tanzu/tanzu-framework/apis/config/v1alpha1"
@@ -104,6 +106,7 @@ var addRepoCmd = &cobra.Command{
104
106
if err != nil {
105
107
return err
106
108
}
109
+ log .Successf ("successfully added repository %s" , pluginRepo .GCPPluginRepository .Name )
107
110
return nil
108
111
},
109
112
}
@@ -152,6 +155,7 @@ var updateRepoCmd = &cobra.Command{
152
155
if err != nil {
153
156
return err
154
157
}
158
+ log .Successf ("successfully updated repository configuration for %s" , repoName )
155
159
return nil
156
160
},
157
161
}
@@ -191,6 +195,7 @@ var deleteRepoCmd = &cobra.Command{
191
195
if err != nil {
192
196
return err
193
197
}
198
+ log .Successf ("successfully deleted repository %s" , repoName )
194
199
return nil
195
200
},
196
201
}
You can’t perform that action at this time.
0 commit comments