@@ -36,26 +36,41 @@ import (
3636 pb "k8s.io/cri-api/pkg/apis/runtime/v1"
3737)
3838
39+ var pullFlags = []cli.Flag {
40+ & cli.StringFlag {
41+ Name : "creds" ,
42+ Usage : "Use `USERNAME[:PASSWORD]` for accessing the registry" ,
43+ EnvVars : []string {"CRICTL_CREDS" },
44+ },
45+ & cli.StringFlag {
46+ Name : "auth" ,
47+ Usage : "Use `AUTH_STRING` for accessing the registry. AUTH_STRING is a base64 encoded 'USERNAME[:PASSWORD]'" ,
48+ EnvVars : []string {"CRICTL_AUTH" },
49+ },
50+ & cli.StringFlag {
51+ Name : "username" ,
52+ Aliases : []string {"u" },
53+ Usage : "Use `USERNAME` for accessing the registry. The password will be requested on the command line" ,
54+ },
55+ & cli.DurationFlag {
56+ Name : "pull-timeout" ,
57+ Aliases : []string {"pt" },
58+ Usage : "Maximum time to be used for pulling the image, disabled if set to 0s" ,
59+ EnvVars : []string {"CRICTL_PULL_TIMEOUT" },
60+ },
61+ }
62+
63+ var cancelTimeoutFlag = & cli.DurationFlag {
64+ Name : "cancel-timeout" ,
65+ Aliases : []string {"T" },
66+ Usage : "Seconds to wait for the request to complete before cancelling" ,
67+ }
68+
3969var pullImageCommand = & cli.Command {
4070 Name : "pull" ,
4171 Usage : "Pull an image from a registry" ,
4272 UseShortOptionHandling : true ,
43- Flags : []cli.Flag {
44- & cli.StringFlag {
45- Name : "creds" ,
46- Usage : "Use `USERNAME[:PASSWORD]` for accessing the registry" ,
47- EnvVars : []string {"CRICTL_CREDS" },
48- },
49- & cli.StringFlag {
50- Name : "auth" ,
51- Usage : "Use `AUTH_STRING` for accessing the registry. AUTH_STRING is a base64 encoded 'USERNAME[:PASSWORD]'" ,
52- EnvVars : []string {"CRICTL_AUTH" },
53- },
54- & cli.StringFlag {
55- Name : "username" ,
56- Aliases : []string {"u" },
57- Usage : "Use `USERNAME` for accessing the registry. The password will be requested on the command line" ,
58- },
73+ Flags : append ([]cli.Flag {
5974 & cli.StringFlag {
6075 Name : "pod-config" ,
6176 Usage : "Use `pod-config.[json|yaml]` to override the pull c" ,
@@ -66,13 +81,7 @@ var pullImageCommand = &cli.Command{
6681 Aliases : []string {"a" },
6782 Usage : "Annotation to be set on the pulled image" ,
6883 },
69- & cli.DurationFlag {
70- Name : "pull-timeout" ,
71- Aliases : []string {"pt" },
72- Usage : "Maximum time to be used for pulling the image, disabled if set to 0s" ,
73- EnvVars : []string {"CRICTL_PULL_TIMEOUT" },
74- },
75- },
84+ }, pullFlags ... ),
7685 Subcommands : []* cli.Command {{
7786 Name : "jsonschema" ,
7887 Aliases : []string {"js" },
0 commit comments