@@ -22,23 +22,34 @@ import (
22
22
"strconv"
23
23
"strings"
24
24
25
+ "github.com/sirupsen/logrus"
25
26
"github.com/urfave/cli/v2"
26
27
27
28
"sigs.k8s.io/cri-tools/pkg/common"
28
29
)
29
30
30
31
var configCommand = & cli.Command {
31
32
Name : "config" ,
32
- Usage : "Get and set crictl client configuration options" ,
33
+ Usage : "Get, set and list crictl configuration options" ,
33
34
ArgsUsage : `[<crictl options>]
34
35
35
- EXAMPLE:
36
+ EXAMPLES:
37
+ # Set the key "debug" to "true"
36
38
crictl config --set debug=true
37
39
40
+ # Set the key "debug" to "true"
41
+ crictl config debug true
42
+
43
+ # Get the value of "debug"
44
+ crictl config --get debug
45
+
46
+ # Show the full configuration
47
+ crictl config --list
48
+
38
49
CRICTL OPTIONS:
39
- runtime-endpoint: Container runtime endpoint
40
- image-endpoint: Image endpoint
41
- timeout: Timeout of connecting to server (default: 2s )
50
+ runtime-endpoint: Container Runtime Interface (CRI) runtime endpoint (default: "")
51
+ image-endpoint: Container Runtime Interface (CRI) image endpoint (default: "")
52
+ timeout: Timeout of connecting to server (default: 2 )
42
53
debug: Enable debug output (default: false)
43
54
pull-image-on-create: Enable pulling image on create requests (default: false)
44
55
disable-pull-on-run: Disable pulling image on run requests (default: false)` ,
@@ -126,8 +137,9 @@ CRICTL OPTIONS:
126
137
return cli .ShowSubcommandHelp (c )
127
138
}
128
139
value := c .Args ().Get (1 )
140
+ logrus .Infof ("No --get, --set or --list provided, setting key %q to value %q" , key , value )
129
141
if err := setValue (key , value , config ); err != nil {
130
- return err
142
+ return fmt . Errorf ( "set %q to %q: %w" , key , value , err )
131
143
}
132
144
return common .WriteConfig (config , configFile )
133
145
},
0 commit comments