@@ -68,6 +68,8 @@ _rkt() {
68
68
cat-manifest)
69
69
_arguments \
70
70
' --pretty-print[apply indent to format the output]' \
71
+ ' --uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
72
+ ' 1:POD:_rkt_pods' \
71
73
;;
72
74
73
75
config)
@@ -78,12 +80,15 @@ _rkt() {
78
80
enter)
79
81
_arguments \
80
82
' --app=:appname' \
83
+ ' 1:POD:_rkt_pods' \
81
84
;;
82
85
83
86
export)
84
87
_arguments \
85
88
' --app=:appname' \
86
89
' --overwrite[overwrite output ACI]' \
90
+ ' 1:POD:_rkt_pods' \
91
+ ' 2:OUTPUT_ACI_FILE:_files' \
87
92
;;
88
93
89
94
fetch)
@@ -98,6 +103,7 @@ _rkt() {
98
103
_arguments \
99
104
' --grace-period=[duration to wait before discarding inactive pods from garbage]:duration' \
100
105
' --expire-prepared=[duration to wait before expiring prepared pods]:duration' \
106
+ ' --mark-only[move to the garbage directories without actually deleting]' \
101
107
;;
102
108
103
109
image)
@@ -120,75 +126,118 @@ _rkt() {
120
126
prepare)
121
127
# TODO: autocomplete stage1 images
122
128
_arguments \
129
+ ' --caps-remove=[capability to remove]:capability' \
130
+ ' --caps-retain=[capability to retain]:capability' \
131
+ ' --cpu=[cpu limit for the preceding image]:cpu limit' \
132
+ ' --cpu-shares=[assign the specified CPU time share weight]:weight' \
133
+ " --environment=[set the app's environment variables]:variable key=value" \
123
134
' --exec=[override the exec command for the preceding image]:command' \
135
+ ' --group=[group override for the preceding image]:group' \
124
136
' --inherit-env[inherit all environment variables not set by apps]' \
137
+ ' --memory=[memory limit for the preceding image]:memory' \
125
138
' --mount=[mount point binding a volume to a path within an app]:mount point' \
139
+ ' --name=[set the name of the app]:name' \
126
140
' --no-overlay[disable overlay filesystem]' \
127
- ' --no-store[fetch images ignoring the local store] ' \
141
+ ' --oom-score-adj=[oom-score-adj isolator override]:oom-score-adj ' \
128
142
' --pod-manifest=[the path to the pod manifest]:manifest:_files' \
129
143
' --port=[ports to expose on the host]:NAME\:HOSTPORT' \
130
144
' --private-users[run within user namespaces]' \
131
145
' --quiet[suppress superfluous output on stdout, print only the UUID on success]' \
146
+ ' --readonly-rootfs=[mount rootfs read-only]:fs' \
132
147
' --set-env=[an environment variable to set for apps]:NAME=VALUE' \
148
+ ' --set-env-file=[the path to an environment variables file]:file:_files' \
133
149
' --signature=[local signature file to use in validating the preceding image]:signature:_files' \
134
150
' --stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
135
151
' --stage1-hash=[a hash of an image to use as stage1]:image hash' \
136
152
' --stage1-name=[a name of an image to use as stage1]:image name' \
137
153
' --stage1-path=[a path to an image to use as stage1]:image path:_files' \
138
154
' --stage1-url=[a URL to an image to use as stage1]:image url' \
139
- ' --store-only[use only available images in the store]' \
155
+ ' --supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \
156
+ ' --user=[user override for the preceding image]:user' \
157
+ " --user-annotation=[set the app's annotations]:annotation key=value" \
158
+ " --user-label=[set the app's labels]:label key=value" \
140
159
' --volume=[volumes to make available in the pod]:volume' \
160
+ ' --working-dir=[override the working directory of the preceding image]:working directory:_files -/' \
161
+ ' 1:IMAGE:_rkt_images' \
141
162
;;
142
163
143
164
rm)
144
165
_arguments \
145
166
' --uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
167
+ ' 1:POD:_rkt_pods' \
146
168
;;
147
169
148
170
run)
149
171
_arguments \
172
+ ' --caps-remove=[capability to remove]:capability' \
173
+ ' --caps-retain=[capability to retain]:capability' \
150
174
' --cpu=[cpu limit for the preceding image]:cpu limit' \
175
+ ' --cpu-shares=[assign the specified CPU time share weight]:weight' \
151
176
' --dns=[name servers to write in /etc/resolv.conf]:name servers' \
177
+ ' --dns-domain=[DNS domain to write in]:domain' \
152
178
' --dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
153
179
' --dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
180
+ " --environment=[set the app's environment variables]:variable key=value" \
154
181
' --exec=[override the exec command for the preceding image]:command' \
182
+ ' --group=[group override for the preceding image]:group' \
155
183
" --hostname=[pod's hostname]:hostname" \
184
+ " --hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \
156
185
' --inherit-env[inherit all environment variables not set by apps]' \
157
186
' --interactive[run pod interactively]' \
158
187
' --mds-register[register pod with metadata service]' \
159
188
' --memory=[memory limit for the preceding image]:memory limit' \
189
+ ' --mount=[mount point binding a volume to a path within an app]:mount point' \
190
+ ' --name=[set the name of the app]:name' \
160
191
" --net=[configure the pod's networking]:networks" \
161
192
' --no-overlay[disable overlay filesystem]' \
162
- ' --no-store[fetch images ignoring the local store]' \
163
193
' --pod-manifest=[the path to the pod manifest]:manifest:_files' \
164
194
' --port=[ports to expose on the host]:NAME\:HOSTPORT' \
165
195
' --private-users[run within user namespaces]' \
166
196
' --set-env=[an environment variable to set for apps]:NAME=VALUE' \
197
+ ' --set-env-file=[the path to an environment variables file]:file:_files' \
167
198
' --signature=[local signature file to use in validating the preceding image]:signature:_files' \
168
199
' --stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
169
200
' --stage1-hash=[a hash of an image to use as stage1]:image hash' \
170
201
' --stage1-name=[a name of an image to use as stage1]:image name' \
171
202
' --stage1-path=[a path to an image to use as stage1]:image path:_files' \
172
203
' --stage1-url=[a URL to an image to use as stage1]:image url' \
173
- ' --store-only[use only available images in the store]' \
204
+ ' --supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \
205
+ ' --user=[user override for the preceding image]:user' \
206
+ " --user-annotation=[set the app's annotations]:annotation key=value" \
207
+ " --user-label=[set the app's labels]:label key=value" \
174
208
' --uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \
175
209
' --volume=[volumes to make available in the pod]:volume' \
210
+ ' --working-dir=[override the working directory of the preceding image]:working directory:_files -/' \
211
+ ' 1:IMAGE:_rkt_images' \
176
212
;;
177
213
178
214
run-prepared)
179
215
_arguments \
180
216
' --dns=[name servers to write in /etc/resolv.conf]:name servers' \
217
+ ' --dns-domain=[DNS domain to write in]:domain' \
181
218
' --dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
182
219
' --dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
183
220
" --hostname=[pod's hostname]:hostname" \
221
+ " --hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \
184
222
' --interactive[run pod interactively]' \
185
223
' --mds-register[register pod with metadata service]' \
186
224
" --net=[configure the pod's networking]:networks" \
225
+ ' 1:POD:_rkt_pods' \
187
226
;;
188
227
189
228
status)
190
229
_arguments \
191
- ' --wait[toggle waiting for the pod to exit]' \
230
+ ' --format=[choose the output format]:format:(json json-pretty)' \
231
+ ' --wait[toggles waiting for the pod to exit]' \
232
+ ' --wait-ready[toggles waiting until the pod is ready]' \
233
+ ' 1:POD:_rkt_pods' \
234
+ ;;
235
+
236
+ stop)
237
+ _arguments \
238
+ ' --force[forced stopping]' \
239
+ ' --uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
240
+ ' 1:POD:_rkt_pods' \
192
241
;;
193
242
194
243
trust)
@@ -217,6 +266,22 @@ _rkt() {
217
266
cat-manifest)
218
267
_arguments \
219
268
' --pretty-print[apply indent to format the output]' \
269
+ ' 1:IMAGE:_rkt_images' \
270
+ ;;
271
+
272
+ export)
273
+ _arguments \
274
+ ' --overwrite[overwrite output ACI]' \
275
+ ' 1:IMAGE:_rkt_images' \
276
+ ' 2:OUTPUT_ACI_FILE:_files' \
277
+ ;;
278
+
279
+ extract|render)
280
+ _arguments \
281
+ ' --overwrite[overwrite output ACI]' \
282
+ ' --rootfs-only[extract rootfs only]' \
283
+ ' 1:IMAGE:_rkt_images' \
284
+ ' 2:OUTPUT_DIR:_files -/' \
220
285
;;
221
286
222
287
gc)
@@ -233,7 +298,7 @@ _rkt() {
233
298
234
299
rm)
235
300
_arguments \
236
- ' :image ' \
301
+ ' *:IMAGE:_rkt_images ' \
237
302
;;
238
303
esac
239
304
;;
@@ -258,6 +323,7 @@ _rkt_cmds() {
258
323
' run:Run image(s) in a pod in rkt'
259
324
' run-prepared:Run a prepared application pod in rkt'
260
325
' status:Check the status of a rkt pod'
326
+ ' stop:Stop a pod'
261
327
' trust:Trust a key for image verification'
262
328
' version:Print the version and exit'
263
329
' help:Help about any command'
@@ -269,13 +335,29 @@ _rkt_image_cmds() {
269
335
local -a commands
270
336
commands=(
271
337
' cat-manifest:Inspect and print the image manifest'
338
+ ' export:Export a stored image to an ACI file'
339
+ ' extract:Extract a stored image to a directory'
272
340
' gc:Garbage collect local store'
273
341
' list:List images in the local store'
342
+ ' render:Render a stored image to a directory with all its dependencies'
274
343
' rm:Remove image(s) with the given ID(s) or name(s) from the local store'
275
344
)
276
345
_describe ' command' commands
277
346
}
278
347
348
+ _rkt_images () {
349
+ local -a images
350
+ images=($( rkt image list --fields id,name --no-legend | sed ' s/\t/\n/;s/:/\\:/g' | sort | uniq) )
351
+ _describe ' IMAGE' images
352
+ }
353
+
354
+ _rkt_pods () {
355
+ local -a pods
356
+ IFS=$' \n '
357
+ pods=($( rkt list --full --no-legend | sed ' s/:/\\:/g;s/\t/:/;s/\t/ /g' ) )
358
+ _describe ' POD' pods
359
+ }
360
+
279
361
_rkt " $@ "
280
362
281
363
# Local Variables:
0 commit comments