Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/crio/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ func main() {

app.Commands = criocli.DefaultCommands
app.Commands = append(app.Commands, []*cli.Command{
criocli.CheckCommand,
criocli.ConfigCommand,
criocli.PublishCommand,
criocli.StatusCommand,
criocli.VersionCommand,
criocli.WipeCommand,
criocli.StatusCommand,
}...)

app.Before = func(c *cli.Context) (err error) {
Expand Down
3 changes: 2 additions & 1 deletion completions/bash/crio
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ completion
man
markdown
md
check
config
status
version
wipe
status
help
h
--absent-mount-sources-to-reject
Expand Down
41 changes: 33 additions & 8 deletions completions/fish/crio.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function __fish_crio_no_subcommand --description 'Test if there has been any subcommand yet'
for i in (commandline -opc)
if contains -- $i complete completion help h man markdown md config version wipe status config c containers container cs s info i help h
if contains -- $i complete completion help h man markdown md check config status config c containers container cs s info i version wipe help h
return 1
end
end
Expand Down Expand Up @@ -182,6 +182,31 @@ complete -c crio -n '__fish_seen_subcommand_from man' -f -l help -s h -d 'show h
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'man' -d 'Generate the man page documentation.'
complete -c crio -n '__fish_seen_subcommand_from markdown md' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'markdown md' -d 'Generate the markdown documentation.'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'check' -d 'Check CRI-O storage directory for errors.

This command can also repair damaged containers, images and layers.

By default, the data integrity of the storage directory is verified,
which can be an I/O and CPU-intensive operation. The --quick option
can be used to reduce the number of checks run.

When using the --repair option, especially with the --force option,
CRI-O and any currently running containers should be stopped if
possible to ensure no concurrent access to the storage directory
occurs.

The --wipe option can be used to automatically attempt to remove
containers and images on a repair failure. This option, combined
with the --force option, can be used to entirely remove the storage
directory content in case of irrecoverable errors. This should be
used as a last resort, and similarly to the --repair option, it\'s
best if CRI-O and any currently running containers are stopped.'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l age -s a -r -d 'Maximum allowed age for unreferenced layers'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l force -s f -d 'Remove damaged containers'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l repair -s r -d 'Remove damaged images and layers'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l quick -s q -d 'Perform only quick checks'
complete -c crio -n '__fish_seen_subcommand_from check' -f -l wipe -s w -d 'Wipe storage directory on repair failure'
complete -c crio -n '__fish_seen_subcommand_from config' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'config' -d 'Outputs a commented version of the configuration file that could be used
by CRI-O. This allows you to save you current configuration setup and then load
Expand All @@ -202,13 +227,6 @@ complete -c crio -n '__fish_seen_subcommand_from config' -f -l migrate-defaults
defaults between versions. To save a custom configuration change, it should
be in a drop-in configuration file instead.
Possible values: "1.17"'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'version' -d 'display detailed version information'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l json -s j -d 'print JSON instead of text'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l verbose -s v -d 'print verbose information (for example all golang dependencies)'
complete -c crio -n '__fish_seen_subcommand_from wipe' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'wipe' -d 'wipe CRI-O\'s container and image storage'
complete -c crio -n '__fish_seen_subcommand_from wipe' -f -l force -s f -d 'force wipe by skipping the version check'
complete -c crio -n '__fish_seen_subcommand_from status' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'status' -d 'Display status information'
complete -c crio -n '__fish_seen_subcommand_from status' -l socket -s s -r -d 'absolute path to the unix socket'
Expand All @@ -219,5 +237,12 @@ complete -r -c crio -n '__fish_seen_subcommand_from status' -a 'containers conta
complete -c crio -n '__fish_seen_subcommand_from containers container cs s' -f -l id -s i -r -d 'the container ID'
complete -c crio -n '__fish_seen_subcommand_from info i' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_seen_subcommand_from status' -a 'info i' -d 'Retrieve generic information about CRI-O, such as the cgroup and storage driver.'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'version' -d 'display detailed version information'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l json -s j -d 'print JSON instead of text'
complete -c crio -n '__fish_seen_subcommand_from version' -f -l verbose -s v -d 'print verbose information (for example all golang dependencies)'
complete -c crio -n '__fish_seen_subcommand_from wipe' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'wipe' -d 'wipe CRI-O\'s container and image storage'
complete -c crio -n '__fish_seen_subcommand_from wipe' -f -l force -s f -d 'force wipe by skipping the version check'
complete -c crio -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
complete -r -c crio -n '__fish_crio_no_subcommand' -a 'help h' -d 'Shows a list of commands or help for one command'
21 changes: 20 additions & 1 deletion completions/zsh/_crio
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,31 @@ _cli_zsh_autocomplete() {
'man:Generate the man page documentation.'
'markdown:Generate the markdown documentation.'
'md:Generate the markdown documentation.'
"check:Check CRI-O storage directory for errors.

This command can also repair damaged containers, images and layers.

By default, the data integrity of the storage directory is verified,
which can be an I/O and CPU-intensive operation. The --quick option
can be used to reduce the number of checks run.

When using the --repair option, especially with the --force option,
CRI-O and any currently running containers should be stopped if
possible to ensure no concurrent access to the storage directory
occurs.

The --wipe option can be used to automatically attempt to remove
containers and images on a repair failure. This option, combined
with the --force option, can be used to entirely remove the storage
directory content in case of irrecoverable errors. This should be
used as a last resort, and similarly to the --repair option, it's
best if CRI-O and any currently running containers are stopped."
'config:Outputs a commented version of the configuration file that could be used
by CRI-O. This allows you to save you current configuration setup and then load
it later with **--config**. Global options will modify the output.'
'status:Display status information'
'version:display detailed version information'
"wipe:wipe CRI-O's container and image storage"
'status:Display status information'
'help:Shows a list of commands or help for one command'
'h:Shows a list of commands or help for one command'
)
Expand Down
1 change: 1 addition & 0 deletions contrib/test/ci/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
+ ['config.bats'] | product(kata_skip_config_tests) \
+ ['config_migrate.bats'] | product(kata_skip_config_migrate_tests) \
+ ['reload_config.bats'] | product(kata_skip_reload_config) \
+ ['crio-check.bats'] | product(kata_skip_crio_check_tests) \
+ ['crio-wipe.bats'] | product(kata_skip_crio_wipe_tests) \
+ ['ctr.bats'] | product(kata_skip_ctr_tests) \
+ ['devices.bats'] | product(kata_skip_devices_tests) \
Expand Down
3 changes: 3 additions & 0 deletions contrib/test/ci/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,15 @@ kata_skip_config_migrate_tests:
- 'test "config migrate should succeed with 1.17 config"'
kata_skip_reload_config:
- 'test "reload config should remove pinned images when an empty list is provided"'
kata_skip_crio_check_tests:
- 'test "storage directory check should wipe everything on repair errors"'
kata_skip_crio_wipe_tests:
- 'test "clear neither when remove persist"'
- "test \"don't clear containers on a forced restart of crio\""
- "test \"don't clear containers if clean shutdown supported file not present\""
- "test \"internal_wipe don't clear containers on a forced restart of crio\""
- 'test "internal_wipe eventually cleans network on forced restart of crio if network is slow to come up"'
- 'test "recover from badly corrupted storage directory"'
kata_skip_ctr_tests:
- 'test "ctr logging"'
- 'test "ctr journald logging"'
Expand Down
60 changes: 46 additions & 14 deletions docs/crio.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,38 @@ Generate the markdown documentation.

Shows a list of commands or help for one command

## check

Check CRI-O storage directory for errors.

This command can also repair damaged containers, images and layers.

By default, the data integrity of the storage directory is verified,
which can be an I/O and CPU-intensive operation. The --quick option
can be used to reduce the number of checks run.

When using the --repair option, especially with the --force option,
CRI-O and any currently running containers should be stopped if
possible to ensure no concurrent access to the storage directory
occurs.

The --wipe option can be used to automatically attempt to remove
containers and images on a repair failure. This option, combined
with the --force option, can be used to entirely remove the storage
directory content in case of irrecoverable errors. This should be
used as a last resort, and similarly to the --repair option, it's
best if CRI-O and any currently running containers are stopped.

**--age, -a**="": Maximum allowed age for unreferenced layers (default: "24h")

**--force, -f**: Remove damaged containers

**--quick, -q**: Perform only quick checks

**--repair, -r**: Remove damaged images and layers

**--wipe, -w**: Wipe storage directory on repair failure

## config

Outputs a commented version of the configuration file that could be used
Expand All @@ -486,20 +518,6 @@ it later with **--config**. Global options will modify the output.
be in a drop-in configuration file instead.
Possible values: "1.17" (default: "1.17")

## version

display detailed version information

**--json, -j**: print JSON instead of text

**--verbose, -v**: print verbose information (for example all golang dependencies)

## wipe

wipe CRI-O's container and image storage

**--force, -f**: force wipe by skipping the version check

## status

Display status information
Expand All @@ -520,6 +538,20 @@ Display detailed information about the provided container ID.

Retrieve generic information about CRI-O, such as the cgroup and storage driver.

## version

display detailed version information

**--json, -j**: print JSON instead of text

**--verbose, -v**: print verbose information (for example all golang dependencies)

## wipe

wipe CRI-O's container and image storage

**--force, -f**: force wipe by skipping the version check

## help, h

Shows a list of commands or help for one command
Expand Down
Loading