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
2 changes: 1 addition & 1 deletion completions/fish/crio.fish
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ complete -c crio -n '__fish_crio_no_subcommand' -f -l insecure-registry -r -d 'E
be enabled for testing purposes**. For increased security, users should add
their CA to their system\'s list of trusted CAs instead of using
\'--insecure-registry\'.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l internal-wipe -d 'Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l internal-wipe -d 'Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations. This option is deprecated, and will be removed in the future.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l irqbalance-config-file -r -d 'The irqbalance service config file which is used by CRI-O.'
complete -c crio -n '__fish_crio_no_subcommand' -l listen -r -d 'Path to the CRI-O socket'
complete -c crio -n '__fish_crio_no_subcommand' -l log -r -d 'Set the log file path where internal debug information is written'
Expand Down
2 changes: 1 addition & 1 deletion docs/crio.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ crio [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
their CA to their system's list of trusted CAs instead of using
'--insecure-registry'. (default: [])

**--internal-wipe**: Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations.
**--internal-wipe**: Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations. This option is deprecated, and will be removed in the future.

**--irqbalance-config-file**="": The irqbalance service config file which is used by CRI-O. (default: /etc/sysconfig/irqbalance)

Expand Down
3 changes: 2 additions & 1 deletion docs/crio.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ CRI-O reads its storage defaults from the containers-storage.conf(5) file locate
It is used to check if crio wipe should wipe images, which should
only happen when CRI-O has been upgraded

**internal_wipe**=false
**internal_wipe**=true
Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts.
If set to false, one must run `crio wipe` to wipe the containers and images in these situations.
This option is deprecated, and will be removed in the future.

**clean_shutdown_file**="/var/lib/crio/clean.shutdown"
Location for CRI-O to lay down the clean shutdown file.
Expand Down
2 changes: 1 addition & 1 deletion internal/criocli/criocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ func getCrioFlags(defConf *libconfig.Config) []cli.Flag {
},
&cli.BoolFlag{
Name: "internal-wipe",
Usage: "Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations.",
Usage: "Whether CRI-O should wipe containers after a reboot and images after an upgrade when the server starts. If set to false, one must run `crio wipe` to wipe the containers and images in these situations. This option is deprecated, and will be removed in the future.",
Value: defConf.InternalWipe,
EnvVars: []string{"CONTAINER_INTERNAL_WIPE"},
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ type RootConfig struct {

// InternalWipe is whether CRI-O should wipe containers and images after a reboot when the server starts.
// If set to false, one must use the external command `crio wipe` to wipe the containers and images in these situations.
// The option InternalWipe is deprecated, and will be removed in a future release.
InternalWipe bool `toml:"internal_wipe"`
}

Expand Down Expand Up @@ -642,6 +643,7 @@ func DefaultConfig() (*Config, error) {
VersionFile: CrioVersionPathTmp,
VersionFilePersist: CrioVersionPathPersist,
CleanShutdownFile: CrioCleanShutdownFile,
InternalWipe: true,
},
APIConfig: APIConfig{
Listen: CrioSocketPath,
Expand Down
30 changes: 15 additions & 15 deletions test/crio-wipe.bats
Original file line number Diff line number Diff line change
Expand Up @@ -80,38 +80,38 @@ function start_crio_with_stopped_pod() {
}

@test "remove containers and images when remove both" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

rm "$CONTAINER_VERSION_FILE"
rm "$CONTAINER_VERSION_FILE_PERSIST"
run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup
test_crio_wiped_containers
test_crio_wiped_images
}

@test "remove containers when remove temporary" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

rm "$CONTAINER_VERSION_FILE"
run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup
test_crio_wiped_containers
test_crio_did_not_wipe_images
}

@test "clear neither when remove persist" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

rm "$CONTAINER_VERSION_FILE_PERSIST"
run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup
test_crio_did_not_wipe_containers
test_crio_did_not_wipe_images
}
Expand All @@ -121,7 +121,7 @@ function start_crio_with_stopped_pod() {
skip "Podman not installed"
fi

start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

run_podman_with_args run --name test -d quay.io/crio/busybox:latest top
Expand All @@ -132,15 +132,15 @@ function start_crio_with_stopped_pod() {
}

@test "do clear everything when shutdown file not found" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

rm "$CONTAINER_CLEAN_SHUTDOWN_FILE"
rm "$CONTAINER_VERSION_FILE"

run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup

test_crio_wiped_containers
test_crio_wiped_images
Expand All @@ -151,7 +151,7 @@ function start_crio_with_stopped_pod() {
skip "Podman not installed"
fi

start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

run_podman_with_args run --name test quay.io/crio/busybox:latest ls
Expand All @@ -172,7 +172,7 @@ function start_crio_with_stopped_pod() {
skip "Podman not installed"
fi

start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

# all podman containers would be stopped after a reboot
Expand All @@ -188,26 +188,26 @@ function start_crio_with_stopped_pod() {
}

@test "don't clear containers on a forced restart of crio" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean "-9" || true

run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup

test_crio_did_not_wipe_containers
test_crio_did_not_wipe_images
}

@test "don't clear containers if clean shutdown supported file not present" {
start_crio_with_stopped_pod
CONTAINER_INTERNAL_WIPE=false start_crio_with_stopped_pod
stop_crio_no_clean

rm "$CONTAINER_CLEAN_SHUTDOWN_FILE.supported"

run_crio_wipe

start_crio_no_setup
CONTAINER_INTERNAL_WIPE=false start_crio_no_setup

test_crio_did_not_wipe_containers
test_crio_did_not_wipe_images
Expand Down