commit
89dcaeb562
94
src/_rkt
94
src/_rkt
|
@ -68,6 +68,8 @@ _rkt() {
|
||||||
cat-manifest)
|
cat-manifest)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--pretty-print[apply indent to format the output]' \
|
'--pretty-print[apply indent to format the output]' \
|
||||||
|
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
config)
|
config)
|
||||||
|
@ -78,12 +80,15 @@ _rkt() {
|
||||||
enter)
|
enter)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--app=:appname' \
|
'--app=:appname' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
export)
|
export)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--app=:appname' \
|
'--app=:appname' \
|
||||||
'--overwrite[overwrite output ACI]' \
|
'--overwrite[overwrite output ACI]' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
|
'2:OUTPUT_ACI_FILE:_files' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
fetch)
|
fetch)
|
||||||
|
@ -98,6 +103,7 @@ _rkt() {
|
||||||
_arguments \
|
_arguments \
|
||||||
'--grace-period=[duration to wait before discarding inactive pods from garbage]:duration' \
|
'--grace-period=[duration to wait before discarding inactive pods from garbage]:duration' \
|
||||||
'--expire-prepared=[duration to wait before expiring prepared pods]:duration' \
|
'--expire-prepared=[duration to wait before expiring prepared pods]:duration' \
|
||||||
|
'--mark-only[move to the garbage directories without actually deleting]' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
image)
|
image)
|
||||||
|
@ -120,75 +126,118 @@ _rkt() {
|
||||||
prepare)
|
prepare)
|
||||||
# TODO: autocomplete stage1 images
|
# TODO: autocomplete stage1 images
|
||||||
_arguments \
|
_arguments \
|
||||||
|
'--caps-remove=[capability to remove]:capability' \
|
||||||
|
'--caps-retain=[capability to retain]:capability' \
|
||||||
|
'--cpu=[cpu limit for the preceding image]:cpu limit' \
|
||||||
|
'--cpu-shares=[assign the specified CPU time share weight]:weight' \
|
||||||
|
"--environment=[set the app's environment variables]:variable key=value" \
|
||||||
'--exec=[override the exec command for the preceding image]:command' \
|
'--exec=[override the exec command for the preceding image]:command' \
|
||||||
|
'--group=[group override for the preceding image]:group' \
|
||||||
'--inherit-env[inherit all environment variables not set by apps]' \
|
'--inherit-env[inherit all environment variables not set by apps]' \
|
||||||
|
'--memory=[memory limit for the preceding image]:memory' \
|
||||||
'--mount=[mount point binding a volume to a path within an app]:mount point' \
|
'--mount=[mount point binding a volume to a path within an app]:mount point' \
|
||||||
|
'--name=[set the name of the app]:name' \
|
||||||
'--no-overlay[disable overlay filesystem]' \
|
'--no-overlay[disable overlay filesystem]' \
|
||||||
'--no-store[fetch images ignoring the local store]' \
|
'--oom-score-adj=[oom-score-adj isolator override]:oom-score-adj' \
|
||||||
'--pod-manifest=[the path to the pod manifest]:manifest:_files' \
|
'--pod-manifest=[the path to the pod manifest]:manifest:_files' \
|
||||||
'--port=[ports to expose on the host]:NAME\:HOSTPORT' \
|
'--port=[ports to expose on the host]:NAME\:HOSTPORT' \
|
||||||
'--private-users[run within user namespaces]' \
|
'--private-users[run within user namespaces]' \
|
||||||
'--quiet[suppress superfluous output on stdout, print only the UUID on success]' \
|
'--quiet[suppress superfluous output on stdout, print only the UUID on success]' \
|
||||||
|
'--readonly-rootfs=[mount rootfs read-only]:fs' \
|
||||||
'--set-env=[an environment variable to set for apps]:NAME=VALUE' \
|
'--set-env=[an environment variable to set for apps]:NAME=VALUE' \
|
||||||
|
'--set-env-file=[the path to an environment variables file]:file:_files' \
|
||||||
'--signature=[local signature file to use in validating the preceding image]:signature:_files' \
|
'--signature=[local signature file to use in validating the preceding image]:signature:_files' \
|
||||||
'--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
|
'--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
|
||||||
'--stage1-hash=[a hash of an image to use as stage1]:image hash' \
|
'--stage1-hash=[a hash of an image to use as stage1]:image hash' \
|
||||||
'--stage1-name=[a name of an image to use as stage1]:image name' \
|
'--stage1-name=[a name of an image to use as stage1]:image name' \
|
||||||
'--stage1-path=[a path to an image to use as stage1]:image path:_files' \
|
'--stage1-path=[a path to an image to use as stage1]:image path:_files' \
|
||||||
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
||||||
'--store-only[use only available images in the store]' \
|
'--supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \
|
||||||
|
'--user=[user override for the preceding image]:user' \
|
||||||
|
"--user-annotation=[set the app's annotations]:annotation key=value" \
|
||||||
|
"--user-label=[set the app's labels]:label key=value" \
|
||||||
'--volume=[volumes to make available in the pod]:volume' \
|
'--volume=[volumes to make available in the pod]:volume' \
|
||||||
|
'--working-dir=[override the working directory of the preceding image]:working directory:_files -/' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rm)
|
rm)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
_arguments \
|
_arguments \
|
||||||
|
'--caps-remove=[capability to remove]:capability' \
|
||||||
|
'--caps-retain=[capability to retain]:capability' \
|
||||||
'--cpu=[cpu limit for the preceding image]:cpu limit' \
|
'--cpu=[cpu limit for the preceding image]:cpu limit' \
|
||||||
|
'--cpu-shares=[assign the specified CPU time share weight]:weight' \
|
||||||
'--dns=[name servers to write in /etc/resolv.conf]:name servers' \
|
'--dns=[name servers to write in /etc/resolv.conf]:name servers' \
|
||||||
|
'--dns-domain=[DNS domain to write in]:domain' \
|
||||||
'--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
|
'--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
|
||||||
'--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
|
'--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
|
||||||
|
"--environment=[set the app's environment variables]:variable key=value" \
|
||||||
'--exec=[override the exec command for the preceding image]:command' \
|
'--exec=[override the exec command for the preceding image]:command' \
|
||||||
|
'--group=[group override for the preceding image]:group' \
|
||||||
"--hostname=[pod's hostname]:hostname" \
|
"--hostname=[pod's hostname]:hostname" \
|
||||||
|
"--hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \
|
||||||
'--inherit-env[inherit all environment variables not set by apps]' \
|
'--inherit-env[inherit all environment variables not set by apps]' \
|
||||||
'--interactive[run pod interactively]' \
|
'--interactive[run pod interactively]' \
|
||||||
'--mds-register[register pod with metadata service]' \
|
'--mds-register[register pod with metadata service]' \
|
||||||
'--memory=[memory limit for the preceding image]:memory limit' \
|
'--memory=[memory limit for the preceding image]:memory limit' \
|
||||||
|
'--mount=[mount point binding a volume to a path within an app]:mount point' \
|
||||||
|
'--name=[set the name of the app]:name' \
|
||||||
"--net=[configure the pod's networking]:networks" \
|
"--net=[configure the pod's networking]:networks" \
|
||||||
'--no-overlay[disable overlay filesystem]' \
|
'--no-overlay[disable overlay filesystem]' \
|
||||||
'--no-store[fetch images ignoring the local store]' \
|
|
||||||
'--pod-manifest=[the path to the pod manifest]:manifest:_files' \
|
'--pod-manifest=[the path to the pod manifest]:manifest:_files' \
|
||||||
'--port=[ports to expose on the host]:NAME\:HOSTPORT' \
|
'--port=[ports to expose on the host]:NAME\:HOSTPORT' \
|
||||||
'--private-users[run within user namespaces]' \
|
'--private-users[run within user namespaces]' \
|
||||||
'--set-env=[an environment variable to set for apps]:NAME=VALUE' \
|
'--set-env=[an environment variable to set for apps]:NAME=VALUE' \
|
||||||
|
'--set-env-file=[the path to an environment variables file]:file:_files' \
|
||||||
'--signature=[local signature file to use in validating the preceding image]:signature:_files' \
|
'--signature=[local signature file to use in validating the preceding image]:signature:_files' \
|
||||||
'--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
|
'--stage1-from-dir=[a filename of an image in stage1 images directory to use as stage1]:image' \
|
||||||
'--stage1-hash=[a hash of an image to use as stage1]:image hash' \
|
'--stage1-hash=[a hash of an image to use as stage1]:image hash' \
|
||||||
'--stage1-name=[a name of an image to use as stage1]:image name' \
|
'--stage1-name=[a name of an image to use as stage1]:image name' \
|
||||||
'--stage1-path=[a path to an image to use as stage1]:image path:_files' \
|
'--stage1-path=[a path to an image to use as stage1]:image path:_files' \
|
||||||
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
||||||
'--store-only[use only available images in the store]' \
|
'--supplementary-gids=[supplementary group IDs override for the preceding image]:group IDs' \
|
||||||
|
'--user=[user override for the preceding image]:user' \
|
||||||
|
"--user-annotation=[set the app's annotations]:annotation key=value" \
|
||||||
|
"--user-label=[set the app's labels]:label key=value" \
|
||||||
'--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \
|
'--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \
|
||||||
'--volume=[volumes to make available in the pod]:volume' \
|
'--volume=[volumes to make available in the pod]:volume' \
|
||||||
|
'--working-dir=[override the working directory of the preceding image]:working directory:_files -/' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
run-prepared)
|
run-prepared)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--dns=[name servers to write in /etc/resolv.conf]:name servers' \
|
'--dns=[name servers to write in /etc/resolv.conf]:name servers' \
|
||||||
|
'--dns-domain=[DNS domain to write in]:domain' \
|
||||||
'--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
|
'--dns-opt=[DNS options to write in /etc/resolv.conf]:dns options' \
|
||||||
'--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
|
'--dns-search=[DNS search domains to write in /etc/resolv.conf]:search domains' \
|
||||||
"--hostname=[pod's hostname]:hostname" \
|
"--hostname=[pod's hostname]:hostname" \
|
||||||
|
"--hosts-entry=[entries to add to the pod-wide /etc/hosts. Pass 'host' to use the host's /etc/hosts]:hosts entry" \
|
||||||
'--interactive[run pod interactively]' \
|
'--interactive[run pod interactively]' \
|
||||||
'--mds-register[register pod with metadata service]' \
|
'--mds-register[register pod with metadata service]' \
|
||||||
"--net=[configure the pod's networking]:networks" \
|
"--net=[configure the pod's networking]:networks" \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
status)
|
status)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--wait[toggle waiting for the pod to exit]' \
|
'--format=[choose the output format]:format:(json json-pretty)' \
|
||||||
|
'--wait[toggles waiting for the pod to exit]' \
|
||||||
|
'--wait-ready[toggles waiting until the pod is ready]' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
_arguments \
|
||||||
|
'--force[forced stopping]' \
|
||||||
|
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
trust)
|
trust)
|
||||||
|
@ -217,6 +266,22 @@ _rkt() {
|
||||||
cat-manifest)
|
cat-manifest)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--pretty-print[apply indent to format the output]' \
|
'--pretty-print[apply indent to format the output]' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
|
;;
|
||||||
|
|
||||||
|
export)
|
||||||
|
_arguments \
|
||||||
|
'--overwrite[overwrite output ACI]' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
|
'2:OUTPUT_ACI_FILE:_files' \
|
||||||
|
;;
|
||||||
|
|
||||||
|
extract|render)
|
||||||
|
_arguments \
|
||||||
|
'--overwrite[overwrite output ACI]' \
|
||||||
|
'--rootfs-only[extract rootfs only]' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
|
'2:OUTPUT_DIR:_files -/' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gc)
|
gc)
|
||||||
|
@ -233,7 +298,7 @@ _rkt() {
|
||||||
|
|
||||||
rm)
|
rm)
|
||||||
_arguments \
|
_arguments \
|
||||||
':image' \
|
'*:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -258,6 +323,7 @@ _rkt_cmds() {
|
||||||
'run:Run image(s) in a pod in rkt'
|
'run:Run image(s) in a pod in rkt'
|
||||||
'run-prepared:Run a prepared application pod in rkt'
|
'run-prepared:Run a prepared application pod in rkt'
|
||||||
'status:Check the status of a rkt pod'
|
'status:Check the status of a rkt pod'
|
||||||
|
'stop:Stop a pod'
|
||||||
'trust:Trust a key for image verification'
|
'trust:Trust a key for image verification'
|
||||||
'version:Print the version and exit'
|
'version:Print the version and exit'
|
||||||
'help:Help about any command'
|
'help:Help about any command'
|
||||||
|
@ -269,13 +335,29 @@ _rkt_image_cmds() {
|
||||||
local -a commands
|
local -a commands
|
||||||
commands=(
|
commands=(
|
||||||
'cat-manifest:Inspect and print the image manifest'
|
'cat-manifest:Inspect and print the image manifest'
|
||||||
|
'export:Export a stored image to an ACI file'
|
||||||
|
'extract:Extract a stored image to a directory'
|
||||||
'gc:Garbage collect local store'
|
'gc:Garbage collect local store'
|
||||||
'list:List images in the local store'
|
'list:List images in the local store'
|
||||||
|
'render:Render a stored image to a directory with all its dependencies'
|
||||||
'rm:Remove image(s) with the given ID(s) or name(s) from the local store'
|
'rm:Remove image(s) with the given ID(s) or name(s) from the local store'
|
||||||
)
|
)
|
||||||
_describe 'command' commands
|
_describe 'command' commands
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_rkt_images() {
|
||||||
|
local -a images
|
||||||
|
images=($(rkt image list --fields id,name --no-legend | sed 's/\t/\n/;s/:/\\:/g' | sort | uniq))
|
||||||
|
_describe 'IMAGE' images
|
||||||
|
}
|
||||||
|
|
||||||
|
_rkt_pods() {
|
||||||
|
local -a pods
|
||||||
|
IFS=$'\n'
|
||||||
|
pods=($(rkt list --full --no-legend | sed 's/:/\\:/g;s/\t/:/;s/\t/ /g'))
|
||||||
|
_describe 'POD' pods
|
||||||
|
}
|
||||||
|
|
||||||
_rkt "$@"
|
_rkt "$@"
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
|
|
Loading…
Reference in New Issue