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

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
2456067
runtimeVM: Vendor typeurl instead of maintain our own copy
fidencio Jan 13, 2021
0f1e09c
runtimeVM: Move metricsToCtrStats() around
fidencio Jan 13, 2021
6748180
runtimeVM: Use containerd/cgroups for metrics
fidencio Jan 13, 2021
904f7cd
runtimeVM: Calculate the WorkingSetBytes stats
fidencio Jan 15, 2021
89bf0fe
Bug 1942608: do not list the image with error locating manifest
QiWang19 Apr 15, 2021
69b1b01
Merge pull request #4776 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 21, 2021
05bced5
Merge pull request #4785 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 21, 2021
6c59e0a
bump to containers/image 5.11.1
haircommander Apr 23, 2021
4dfb6bd
nsmgr: fix some leaks with GetNamespace
haircommander Apr 14, 2021
ad5b19c
nsmgr: remove duplicate IsNSOrErr call
haircommander Apr 14, 2021
2567995
Merge pull request #4794 from haircommander/bump-image-1.21
openshift-merge-robot Apr 23, 2021
dd0b833
Merge pull request #4795 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 24, 2021
a51cc4e
container server: fix silly typo
haircommander Apr 23, 2021
9490230
Merge pull request #4806 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 26, 2021
ff2dacd
main: still rely on logrus (rather than using the internal log)
fidencio Apr 26, 2021
f75a76d
workloads: update how overrides are specified
haircommander Apr 21, 2021
671a5c7
workloads: move to more concrete type
haircommander Apr 22, 2021
0cf86c6
Merge pull request #4811 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 27, 2021
f1f33e4
Use extra context for runtime VM
saschagrunert Apr 26, 2021
bc63075
Merge pull request #4812 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 27, 2021
451e1ad
Merge pull request #4810 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 27, 2021
082ed80
Add After=crio.service dependency to containers and conmon
mrunalp Apr 15, 2021
abd3c2d
Fix RuntimeDefault seccomp behavior if disabled
saschagrunert Apr 22, 2021
8e16457
Fix podman name in README
mrunalp Apr 28, 2021
7030929
Merge pull request #4819 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 28, 2021
fd8043b
Merge pull request #4816 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 29, 2021
e8d733d
Merge pull request #4823 from mrunalp/fix_podman_name_1.21
openshift-merge-robot Apr 30, 2021
7c8d034
config: fix type of privileged_without_host_devices
haircommander Apr 29, 2021
611a01b
Pin gocapability to v0.0.0-20180916011248-d98352740cb2
haircommander Apr 29, 2021
a953b5b
Merge pull request #4831 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 30, 2021
52e15e0
Merge pull request #4829 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Apr 30, 2021
edc347b
resource store: prevent segfault on cleanup step
haircommander May 3, 2021
fd485de
Merge pull request #4846 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 5, 2021
18a3038
server: use background context for network stop
haircommander Apr 26, 2021
af307c7
config: add absent_mount_sources_to_reject option
haircommander May 5, 2021
5602dd4
server: add support for absent_mount_sources_to_reject
haircommander May 4, 2021
a622815
test: add test for absent_mount_sources_to_reject
haircommander May 5, 2021
3f6209a
Merge pull request #4852 from haircommander/cleanup-timeout-network-1.21
openshift-merge-robot May 6, 2021
07becf8
Merge pull request #4857 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 6, 2021
6011f8e
Cleanup pod network on sandbox removal
saschagrunert Apr 15, 2021
e0b4d8b
server: reuse container removal code for infra
haircommander Apr 15, 2021
342c28d
storage: remove RemovePodSandbox function
haircommander Apr 15, 2021
2fffad7
server: breakup stop/remove all functions with internal helpers
haircommander Apr 15, 2021
5e8db6a
config: add InternalWipe
haircommander Apr 15, 2021
1841c71
crio wipe: add support for internal_wipe
haircommander Apr 15, 2021
cd6e440
server: add support for internal_wipe
haircommander Apr 15, 2021
b34003a
test: add test for internal_wipe
haircommander Apr 15, 2021
ac40848
Add resource cleaner retry functionality
saschagrunert Apr 16, 2021
fc54007
server: move newPodNetwork to a more logical place
haircommander Apr 16, 2021
9e81c09
server: get hooks after we've check if a sandbox is already stopped
haircommander Apr 16, 2021
8a2e61d
InternalWipe: retry on failures
haircommander Apr 16, 2021
49ebe5c
test: add test for delayed cleanup of network on restart
haircommander Apr 16, 2021
ec8accd
resourcestore: run cleanup in parallel
haircommander Apr 26, 2021
e7c0a18
server: group namespace cleanup with network stop
haircommander Apr 21, 2021
d568fd6
server: don't unconditionally fail on sandbox cleanup
haircommander Apr 21, 2021
2e241f4
sandbox: fix race with cleanup
haircommander Apr 26, 2021
60df114
use more ContainerServer.StopContainer
haircommander Apr 26, 2021
8fa117f
sandbox remove: unmount shm before removing infra container
haircommander Apr 26, 2021
0f38d58
Merge pull request #4884 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 10, 2021
0f1297a
Fix go.sum
saschagrunert May 11, 2021
a529c77
runtimeVM: Use internal context to ensure goroutines are stopped
fidencio May 7, 2021
b186f24
Merge pull request #4889 from saschagrunert/release-1.21-go-sum
openshift-merge-robot May 11, 2021
8f8bcd9
Merge pull request #4890 from fidencio/wip/release-1.21-runtime-vm-us…
openshift-merge-robot May 12, 2021
5a6a27b
server: properly remove sandbox network on failed restore
haircommander May 13, 2021
847885c
move internal wipe to only wipe images
haircommander May 13, 2021
000501b
ignore storage.ErrNotAContainer
haircommander May 13, 2021
dd4bda8
test: adapt crio wipe tests to handle new behavior
haircommander May 14, 2021
b38f128
reduce listen socket permissions to 0660
haircommander May 10, 2021
a83474c
Merge pull request #4928 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 20, 2021
68f0528
server: reduce log verbosity on restore
haircommander May 20, 2021
dba62a6
server: call CNI del in separate routine in restore
haircommander May 20, 2021
e705872
Merge pull request #4934 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 20, 2021
3ef4247
Merge pull request #4930 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 21, 2021
2f4af82
Add support to drop ALL and add back few capabilities
mrunalp May 20, 2021
1baccda
Merge pull request #4935 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 21, 2021
5f3a265
Fix unit tests
saschagrunert May 21, 2021
1f3c5cb
Merge pull request #4938 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot May 24, 2021
f159ecc
bump runc to 1.0.0-rc94
haircommander May 26, 2021
b7e74a3
Merge pull request #4946 from haircommander/bump-runc-1.21
openshift-merge-robot May 26, 2021
a12ce4e
bump c/storage to 1.31.1
haircommander May 20, 2021
3dfc2a1
Merge pull request #4932 from haircommander/bump-storage-1.31.1-1.21
openshift-merge-robot May 28, 2021
e7ff6ed
oci: do not use conmon for exec sync
haircommander May 25, 2021
d11fbdc
oci: drop internal ExecSync structs
haircommander May 26, 2021
9b6f4e5
Fix CI
saschagrunert Jun 2, 2021
7cccaf3
bump to v1.21.1
haircommander Jun 2, 2021
f635341
Merge pull request #4965 from haircommander/bump-1.21.1
openshift-merge-robot Jun 3, 2021
e1bc46b
Merge pull request #4961 from saschagrunert/release-1.21-ci
openshift-merge-robot Jun 6, 2021
8488050
storage: succeed in DeleteContainer if container is unknown
haircommander Jun 2, 2021
478f49d
Merge pull request #4977 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jun 8, 2021
adce678
server: export InfraName and drop references to leaky
haircommander May 20, 2021
1d6453c
Bump runc to get public RangeToBits function
haircommander May 21, 2021
d166f14
workloads: setup on conmon cgroup
haircommander May 10, 2021
87a065d
test: add test for conmon in workloads
haircommander May 14, 2021
afe8601
workloads: don't set conmon cpuset if systemd doesn't support Allowed…
haircommander May 18, 2021
a239dc0
Disable short name mode
umohnani8 Jun 8, 2021
d3a863f
test: fix cgroupfs workload tests
haircommander Jun 8, 2021
60f15ea
try again on EAGAIN from dbus
haircommander May 19, 2021
6df0952
cgmgr: create systemd manager constructor
haircommander Jun 7, 2021
d0f1325
cgmgr: reuse dbus connection
haircommander Jun 7, 2021
cde0a1d
dbusmgr: protect against races in NewDbusConnManager
haircommander Jun 7, 2021
0252f91
utils: close dbus conn channel
haircommander Jun 7, 2021
0bf27b9
simplify checking for dbus error
haircommander Jun 7, 2021
d259118
dbus: update retryondisconnect to handle eagain too
haircommander Jun 7, 2021
4f19d38
Merge pull request #4984 from umohnani8/r1.21
openshift-merge-robot Jun 8, 2021
0be9ef8
Merge pull request #4980 from haircommander/workload-settings-7-1.21
openshift-merge-robot Jun 8, 2021
8f26da3
Merge pull request #4986 from haircommander/dbus-eagain-1.21
openshift-merge-robot Jun 9, 2021
7e41de0
Merge pull request #4962 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jun 10, 2021
c7c6aba
oci: don't pre-create pid file
haircommander Jun 15, 2021
5f7db4b
oci: kill runtime process on exec if exec pid isn't written yet
haircommander Jun 15, 2021
dfcd2b6
Merge pull request #5002 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jun 16, 2021
e3ace15
Bump c/storage to v1.32.3
saschagrunert Jun 18, 2021
d3e59a4
Merge pull request #5015 from saschagrunert/release-1.21
openshift-merge-robot Jun 21, 2021
0a0bfa8
vendor: bump ocicni to 4ea5fb8752cfe
dcbw Jun 23, 2021
c512346
network: pass pod UID to ocicni when performing network operations
dcbw Jun 23, 2021
30ca719
Merge pull request #5028 from dcbw/121-ocicni-pass-pod-uid
openshift-merge-robot Jun 24, 2021
2a1d38d
server: prevent segfault by not using a potentially nil sandbox
haircommander Jul 7, 2021
8d20153
Merge pull request #5062 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jul 8, 2021
d70cbee
Introduce cnimgr
haircommander Jun 29, 2021
bec5678
config: add cnimgr
haircommander Jun 29, 2021
950abf7
server: use cnimgr for runtime status
haircommander Jun 29, 2021
e259f8e
server: use cnimgr to wait for cni plugin ready before creating a pod
haircommander Jun 29, 2021
f2c1331
version: bump to v1.21.2
haircommander Jul 16, 2021
90bc8f9
vendor: add notify package
haircommander Jul 16, 2021
0420874
oci: refactor fsnotify usage
haircommander Jul 9, 2021
9f95a84
oci: wait for runtime to write pidfile before starting timer
haircommander Jul 9, 2021
fd6dcf3
oci: be more precise about channels and routines
haircommander Jul 16, 2021
f97bf4d
Merge pull request #5084 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jul 16, 2021
e929d72
Merge pull request #5085 from haircommander/bump-1.21.2
openshift-merge-robot Jul 19, 2021
aaefa6b
Merge pull request #5093 from haircommander/exec-inotify-1.21
openshift-merge-robot Jul 19, 2021
6717afc
Fix unit test execution
saschagrunert Jul 19, 2021
b27d974
Merge pull request #5102 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jul 19, 2021
9f3630c
oci: properly handle tty on execsync
haircommander Jul 20, 2021
54a5889
Merge pull request #5121 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jul 23, 2021
99ee81d
Fix propagation of annotations from sandbox to container
frasertweedale Jul 15, 2021
8246f6d
Add regression test for sandbox annotation passthrough
frasertweedale Jul 20, 2021
dd89bfb
Merge pull request #5124 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jul 26, 2021
84bc46b
server: don't repeatedly error with no such id
haircommander Jun 16, 2021
e72c14b
server: fix another repeated no such id error
haircommander Jul 29, 2021
8d4264e
Merge pull request #5138 from haircommander/no-no-such-id-1.21
openshift-merge-robot Jul 30, 2021
6ca99ea
oci: prevent an unlikely segfault
haircommander Jul 27, 2021
478e655
server: don't unnecessarily copy struct
haircommander Jul 27, 2021
4d624ed
oci: rework exec to use fsnotify
haircommander Jul 27, 2021
1622f98
vendor: drop new notify package
haircommander Jul 29, 2021
b9fea34
oci: add exec pid watcher
haircommander Jul 28, 2021
3b87110
Merge pull request #5162 from haircommander/exec-rss-1.21
openshift-ci[bot] Aug 3, 2021
820efd1
scripts: pin cri-tools version
haircommander Aug 16, 2021
5d31399
Merge pull request #5205 from haircommander/cri-tools-version
openshift-ci[bot] Aug 16, 2021
4da5cf3
oci: fix panic on double close
haircommander Aug 17, 2021
6700fde
Merge pull request #5213 from haircommander/reopen-fix-panic-1.21
openshift-ci[bot] Aug 17, 2021
e6af292
main: Don't log an error if the clean shutdown file doesn't exist
cgwalters Jul 30, 2021
52b3f98
Merge pull request #5227 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Aug 19, 2021
d340943
server: don't check storage for image name on inspect
haircommander Aug 2, 2021
cd588bf
Merge pull request #5253 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Aug 26, 2021
e721f21
oci: use conmon for exec again
haircommander Aug 23, 2021
74727d7
Fix missing quantile in `latency_microseconds_total` metrics
saschagrunert Aug 30, 2021
cdc4f56
Merge pull request #5262 from haircommander/exec-revert-1.21
openshift-merge-robot Aug 30, 2021
59a47a9
version: bump to v1.21.3
haircommander Sep 9, 2021
ff0b7fe
Merge pull request #5289 from haircommander/bump-1.21.3
openshift-merge-robot Sep 9, 2021
a25bf1a
oci: call wait on conmon if cgroup move fails
haircommander Sep 8, 2021
cee3ce9
call cmd.Wait() in all cases we call Start()
haircommander Sep 8, 2021
d364d33
vendor: bump oc/selinux to 1.8.5
kolyshkin Sep 23, 2021
3583716
Merge pull request #5346 from kolyshkin/1.21-bump-selinux
openshift-merge-robot Sep 24, 2021
2933275
Merge pull request #5297 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Oct 1, 2021
b6c7cb9
Merge pull request #5266 from saschagrunert/release-1.21-metrics-quan…
openshift-merge-robot Oct 7, 2021
16fc9fc
server: don't recalculate hostnet
haircommander Aug 23, 2021
ada0793
server: use container level host network setting
haircommander Aug 23, 2021
97e20e7
server: mount cgroup if hostNetwork
haircommander Aug 23, 2021
e34bf50
Merge pull request #5389 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Oct 11, 2021
676b2ef
server: reduce args in addOCIBindMounts
haircommander Sep 30, 2021
f1f4351
test: refactor allowed_annotation tests
haircommander Oct 1, 2021
20d8b00
server: conditionally relabel volumes given annotation
haircommander Sep 30, 2021
3876955
server: FilterDisallowedAnnotations of containers earlier
haircommander Oct 1, 2021
17ae1e1
test: fix selinux test failures
haircommander Oct 12, 2021
86e90e0
vendor: update to selinux 1.9.1
haircommander Oct 13, 2021
69f1358
test: skip certificate check for downloading parallel
haircommander Oct 4, 2021
6d3b20e
Skip volume relabel for super privileged containers
saschagrunert Oct 8, 2021
fc5f562
server: don't wait forever on conmon cgroup move fail
haircommander Sep 13, 2021
e87e050
Merge pull request #5407 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Oct 14, 2021
7415a53
Merge pull request #5406 from haircommander/selinux-maybe-1.21
openshift-merge-robot Oct 15, 2021
817526d
Bug 2012838: fix override storage options from storage.conf
QiWang19 Oct 25, 2021
5c6c624
bump to 1.21.4
haircommander Nov 5, 2021
8235379
test: add label for openshift e2e in dockerfile
haircommander Nov 8, 2021
61748dc
Merge pull request #5442 from haircommander/bump-1.21.4
openshift-merge-robot Nov 9, 2021
8cfc2a1
release-notes: update to main
haircommander Nov 8, 2021
b8718c1
gh-actions: add sed for kube e2e
haircommander Nov 8, 2021
84fa55d
Merge pull request #5454 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Nov 12, 2021
1bf2f94
oci: make some channels buffered
haircommander Nov 1, 2021
8feec83
oci: always close chControl
haircommander Nov 1, 2021
f12d4b4
oci: fix deadlock in container stop code
haircommander Nov 3, 2021
c845cf4
Merge pull request #5475 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Dec 2, 2021
156aad9
restore: restore stop before managing namespace
haircommander Sep 13, 2021
9f7eee6
oci: always reap conmon zombies
haircommander Dec 13, 2021
c9f28e4
Merge pull request #5436 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Dec 21, 2021
91c3cb8
Merge pull request #5502 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Jan 4, 2022
eece96c
Use timeout for conmon cgroup move
saschagrunert Dec 10, 2021
f9ec723
cmdrunner: create singleton
haircommander Dec 16, 2021
e3cbdc0
cmdrunner: add tests for prepended commands
haircommander Dec 20, 2021
6331bd2
config: prepend commands with taskset if InfraCtrCPUSet is configured
haircommander Dec 16, 2021
50eca9f
Merge pull request #5556 from haircommander/dbus-stall-1.21
openshift-merge-robot Jan 21, 2022
00d8743
cmdrunner: update mocks and add target to makefile
haircommander Dec 16, 2021
e9ba448
conmonmgr: refactor for new CommandRunner
haircommander Dec 20, 2021
dc80caa
use cmdrunner singleton
haircommander Dec 16, 2021
aebb17b
Merge pull request #5557 from haircommander/taskset-prepend-1.21
openshift-merge-robot Jan 21, 2022
c058478
Merge pull request #5510 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Feb 2, 2022
d7ac1fc
server: fix race with kubelet
haircommander Feb 1, 2022
13048cc
Merge pull request #5666 from openshift-cherrypick-robot/cherry-pick-…
openshift-merge-robot Feb 21, 2022
dd19459
server: skip sysctls that would affect the host
haircommander Jan 27, 2022
1cb18d8
test: add test for skipped sysctls
haircommander Jan 27, 2022
030755e
Merge pull request #5686 from haircommander/sysctl-no-host-1.21
openshift-merge-robot Mar 1, 2022
f3f39d9
bump to 1.21.5
haircommander Mar 4, 2022
af64931
Merge pull request #5705 from haircommander/bump-1.21.5
openshift-merge-robot Mar 5, 2022
d7c79aa
Check stoppedChan before closing
harche Mar 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ linters-settings:
- unnamedResult
- unnecessaryBlock
gocyclo:
min-complexity: 122
min-complexity: 127
nakedret:
max-func-lines: 15
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ testunit-bin:
done

mockgen: \
mock-cmdrunner \
mock-containerstorage \
mock-criostorage \
mock-lib-config \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ It is currently in active development in the Kubernetes community through the [d
| ---------------------------------------------------- | --------------------------------------------------------------------------|
| [crio(8)](/docs/crio.8.md) | OCI Kubernetes Container Runtime daemon |

Note that kpod and its container management and debugging commands have moved to a separate repository, located [here](https://github.com/containers/podman).
Note that podman and its container management and debugging commands have moved to a separate repository, located [here](https://github.com/containers/podman).

## Configuration
| File | Description |
Expand Down
43 changes: 23 additions & 20 deletions cmd/crio/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ func catchShutdown(ctx context.Context, cancel context.CancelFunc, gserver *grpc
case unix.SIGPIPE:
continue
case signals.Interrupt:
log.Debugf(ctx, "Caught SIGINT")
logrus.Debugf("Caught SIGINT")
case signals.Term:
log.Debugf(ctx, "Caught SIGTERM")
logrus.Debugf("Caught SIGTERM")
default:
continue
}
*signalled = true
gserver.GracefulStop()
hserver.Shutdown(ctx) // nolint: errcheck
if err := sserver.StopStreamServer(); err != nil {
log.Warnf(ctx, "error shutting down streaming server: %v", err)
logrus.Warnf("error shutting down streaming server: %v", err)
}
sserver.StopMonitors()
cancel()
if err := sserver.Shutdown(ctx); err != nil {
log.Warnf(ctx, "error shutting down main service %v", err)
logrus.Warnf("error shutting down main service %v", err)
}
return
}
Expand Down Expand Up @@ -185,9 +185,9 @@ func main() {
profilePort := c.Int("profile-port")
profileEndpoint := fmt.Sprintf("localhost:%v", profilePort)
go func() {
log.Debugf(ctx, "starting profiling server on %v", profileEndpoint)
logrus.Debugf("starting profiling server on %v", profileEndpoint)
if err := http.ListenAndServe(profileEndpoint, nil); err != nil {
log.Fatalf(ctx, "unable to run profiling server: %v", err)
logrus.Fatalf("unable to run profiling server: %v", err)
}
}()
}
Expand All @@ -211,7 +211,11 @@ func main() {

lis, err := server.Listen("unix", config.Listen)
if err != nil {
log.Fatalf(ctx, "failed to listen: %v", err)
logrus.Fatalf("Failed to listen: %v", err)
}

if err := os.Chmod(config.Listen, 0o660); err != nil {
logrus.Fatalf("Failed to chmod listen socket %s: %v", config.Listen, err)
}

grpcServer := grpc.NewServer(
Expand Down Expand Up @@ -243,8 +247,7 @@ func main() {

if config.CleanShutdownFile != "" {
// clear out the shutdown file
if err := os.Remove(config.CleanShutdownFile); err != nil {
// not a fatal error, as it could have been cleaned up
if err := os.Remove(config.CleanShutdownFile); err != nil && !os.IsNotExist(err) {
logrus.Error(err)
}

Expand All @@ -254,13 +257,13 @@ func main() {
// CleanShutdownFile.
f, err := os.Create(config.CleanShutdownSupportedFileName())
if err != nil {
log.Errorf(ctx, "Writing clean shutdown supported file: %v", err)
logrus.Errorf("Writing clean shutdown supported file: %v", err)
}
f.Close()

// and sync the changes to disk
if err := utils.SyncParent(config.CleanShutdownFile); err != nil {
log.Errorf(ctx, "failed to sync parent directory of clean shutdown file: %v", err)
logrus.Errorf("failed to sync parent directory of clean shutdown file: %v", err)
}
}

Expand Down Expand Up @@ -300,12 +303,12 @@ func main() {

go func() {
if err := grpcServer.Serve(grpcL); err != nil {
log.Errorf(ctx, "unable to run GRPC server: %v", err)
logrus.Errorf("unable to run GRPC server: %v", err)
}
}()
go func() {
if err := httpServer.Serve(httpL); err != nil {
log.Debugf(ctx, "closed http server")
logrus.Debugf("closed http server")
}
}()

Expand All @@ -316,7 +319,7 @@ func main() {
if graceful && strings.Contains(strings.ToLower(err.Error()), "use of closed network connection") {
err = nil
} else {
log.Errorf(ctx, "Failed to serve grpc request: %v", err)
logrus.Errorf("Failed to serve grpc request: %v", err)
}
}
}()
Expand All @@ -330,22 +333,22 @@ func main() {
}

if err := crioServer.Shutdown(ctx); err != nil {
log.Warnf(ctx, "error shutting down service: %v", err)
logrus.Warnf("error shutting down service: %v", err)
}
cancel()

<-streamServerCloseCh
log.Debugf(ctx, "closed stream server")
logrus.Debugf("closed stream server")
<-serverMonitorsCh
log.Debugf(ctx, "closed monitors")
logrus.Debugf("closed monitors")
err = <-hookSync
if err == nil || err == context.Canceled {
log.Debugf(ctx, "closed hook monitor")
logrus.Debugf("closed hook monitor")
} else {
log.Errorf(ctx, "hook monitor failed: %v", err)
logrus.Errorf("hook monitor failed: %v", err)
}
<-serverCloseCh
log.Debugf(ctx, "closed main server")
logrus.Debugf("closed main server")

return nil
}
Expand Down
9 changes: 9 additions & 0 deletions cmd/crio/wipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func crioWipe(c *cli.Context) error {
return handleCleanShutdown(config, store)
}

// If crio is configured to wipe internally (and `--force` wasn't set)
// the `crio wipe` command has nothing left to do,
// as the remaining work will be done on server startup.
if config.InternalWipe && !c.IsSet("force") {
return nil
}

logrus.Infof("Internal wipe not set, meaning crio wipe will wipe. In the future, all wipes after reboot will happen when starting the crio server.")

// if we should not wipe, exit with no error
if !shouldWipeContainers {
// we should not wipe images without wiping containers
Expand Down
2 changes: 2 additions & 0 deletions completions/bash/crio
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ version
wipe
help
h
--absent-mount-sources-to-reject
--additional-devices
--apparmor-profile
--big-files-temporary-dir
Expand Down Expand Up @@ -48,6 +49,7 @@ h
--image-volumes
--infra-ctr-cpuset
--insecure-registry
--internal-wipe
--irqbalance-config-file
--listen
--log
Expand Down
2 changes: 2 additions & 0 deletions completions/fish/crio.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function __fish_crio_no_subcommand --description 'Test if there has been any sub
return 0
end

complete -c crio -n '__fish_crio_no_subcommand' -f -l absent-mount-sources-to-reject -r -d 'A list of paths that, when absent from the host, will cause a container creation to fail (as opposed to the current behavior of creating a directory).'
complete -c crio -n '__fish_crio_no_subcommand' -f -l additional-devices -r -d 'Devices to add to the containers '
complete -c crio -n '__fish_crio_no_subcommand' -f -l apparmor-profile -r -d 'Name of the apparmor profile to be used as the runtime\'s default. This only takes effect if the user does not specify a profile via the Kubernetes Pod\'s metadata annotation.'
complete -c crio -n '__fish_crio_no_subcommand' -f -l big-files-temporary-dir -r -d 'Path to the temporary directory to use for storing big files, used to store image blobs and data streams related to containers image management.'
Expand Down Expand Up @@ -86,6 +87,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 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 completions/zsh/_crio
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ it later with **--config**. Global options will modify the output.' 'version:dis
_describe 'commands' cmds

local -a opts
opts=('--additional-devices' '--apparmor-profile' '--big-files-temporary-dir' '--bind-mount-prefix' '--cgroup-manager' '--clean-shutdown-file' '--cni-config-dir' '--cni-default-network' '--cni-plugin-dir' '--config' '--config-dir' '--conmon' '--conmon-cgroup' '--conmon-env' '--container-attach-socket-dir' '--container-exits-dir' '--ctr-stop-timeout' '--decryption-keys-path' '--default-capabilities' '--default-env' '--default-mounts-file' '--default-runtime' '--default-sysctls' '--default-transport' '--default-ulimits' '--drop-infra-ctr' '--enable-metrics' '--enable-profile-unix-socket' '--gid-mappings' '--global-auth-file' '--grpc-max-recv-msg-size' '--grpc-max-send-msg-size' '--hooks-dir' '--image-volumes' '--infra-ctr-cpuset' '--insecure-registry' '--irqbalance-config-file' '--listen' '--log' '--log-dir' '--log-filter' '--log-format' '--log-journald' '--log-level' '--log-size-max' '--metrics-port' '--metrics-socket' '--namespaces-dir' '--no-pivot' '--pause-command' '--pause-image' '--pause-image-auth-file' '--pids-limit' '--pinns-path' '--profile' '--profile-port' '--read-only' '--registries-conf' '--registries-conf-dir' '--registry' '--root' '--runroot' '--runtimes' '--seccomp-profile' '--seccomp-use-default-when-empty' '--selinux' '--separate-pull-cgroup' '--signature-policy' '--storage-driver' '--storage-opt' '--stream-address' '--stream-enable-tls' '--stream-idle-timeout' '--stream-port' '--stream-tls-ca' '--stream-tls-cert' '--stream-tls-key' '--uid-mappings' '--version-file' '--version-file-persist' '--help' '--version')
opts=('--absent-mount-sources-to-reject' '--additional-devices' '--apparmor-profile' '--big-files-temporary-dir' '--bind-mount-prefix' '--cgroup-manager' '--clean-shutdown-file' '--cni-config-dir' '--cni-default-network' '--cni-plugin-dir' '--config' '--config-dir' '--conmon' '--conmon-cgroup' '--conmon-env' '--container-attach-socket-dir' '--container-exits-dir' '--ctr-stop-timeout' '--decryption-keys-path' '--default-capabilities' '--default-env' '--default-mounts-file' '--default-runtime' '--default-sysctls' '--default-transport' '--default-ulimits' '--drop-infra-ctr' '--enable-metrics' '--enable-profile-unix-socket' '--gid-mappings' '--global-auth-file' '--grpc-max-recv-msg-size' '--grpc-max-send-msg-size' '--hooks-dir' '--image-volumes' '--infra-ctr-cpuset' '--insecure-registry' '--internal-wipe' '--irqbalance-config-file' '--listen' '--log' '--log-dir' '--log-filter' '--log-format' '--log-journald' '--log-level' '--log-size-max' '--metrics-port' '--metrics-socket' '--namespaces-dir' '--no-pivot' '--pause-command' '--pause-image' '--pause-image-auth-file' '--pids-limit' '--pinns-path' '--profile' '--profile-port' '--read-only' '--registries-conf' '--registries-conf-dir' '--registry' '--root' '--runroot' '--runtimes' '--seccomp-profile' '--seccomp-use-default-when-empty' '--selinux' '--separate-pull-cgroup' '--signature-policy' '--storage-driver' '--storage-opt' '--stream-address' '--stream-enable-tls' '--stream-idle-timeout' '--stream-port' '--stream-tls-ca' '--stream-tls-cert' '--stream-tls-key' '--uid-mappings' '--version-file' '--version-file-persist' '--help' '--version')
_describe 'global options' opts

return
Expand Down
14 changes: 13 additions & 1 deletion contrib/bundle/test-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi

# Bypass local DNS
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

# Prepare the system
ufw disable
ip6tables --list >/dev/null
iptables -F
sysctl -w net.ipv4.conf.all.route_localnet=1
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.bridge.bridge-nf-call-iptables=1
sysctl -w fs.inotify.max_user_watches=1048576
iptables -t nat -I POSTROUTING -s 127.0.0.0/8 ! -d 127.0.0.0/8 -j MASQUERADE

# Assume we're running on this arch
ARCH=amd64

Expand Down Expand Up @@ -82,7 +95,6 @@ echo "Using IP: $IP"
export DNS_SERVER_IP=$IP
export API_HOST_IP=$IP

iptables -F
hack/install-etcd.sh
export PATH="$GOPATH/src/k8s.io/kubernetes/third_party/etcd:$PATH"

Expand Down
2 changes: 1 addition & 1 deletion contrib/test/ci/cri-o.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
%global service_name crio

Name: %{repo}
Version: 1.21.0
Version: 1.21.4
Release: 1.ci%{?dist}
Summary: Kubernetes Container Runtime Interface for OCI-based containers
License: ASL 2.0
Expand Down
1 change: 1 addition & 0 deletions contrib/test/integration/build/parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
src: https://ftp.gnu.org/gnu/parallel/parallel-20190322.tar.bz2
dest: "{{ ansible_env.HOME }}"
remote_src: yes
validate_certs: False
when: ansible_distribution in ['RedHat', 'CentOS']

- name: install parallel from sources
Expand Down
6 changes: 6 additions & 0 deletions docs/crio.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ crio - OCI-based implementation of Kubernetes Container Runtime Interface
crio

```
[--absent-mount-sources-to-reject]=[value]
[--additional-devices]=[value]
[--apparmor-profile]=[value]
[--big-files-temporary-dir]=[value]
Expand Down Expand Up @@ -48,6 +49,7 @@ crio
[--image-volumes]=[value]
[--infra-ctr-cpuset]=[value]
[--insecure-registry]=[value]
[--internal-wipe]
[--irqbalance-config-file]=[value]
[--listen]=[value]
[--log-dir]=[value]
Expand Down Expand Up @@ -117,6 +119,8 @@ crio [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]

# GLOBAL OPTIONS

**--absent-mount-sources-to-reject**="": A list of paths that, when absent from the host, will cause a container creation to fail (as opposed to the current behavior of creating a directory). (default: [])

**--additional-devices**="": Devices to add to the containers (default: [])

**--apparmor-profile**="": Name of the apparmor profile to be used as the runtime's default. This only takes effect if the user does not specify a profile via the Kubernetes Pod's metadata annotation. (default: crio-default)
Expand Down Expand Up @@ -232,6 +236,8 @@ 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.

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

**--listen**="": Path to the CRI-O socket (default: /var/run/crio/crio.sock)
Expand Down
7 changes: 7 additions & 0 deletions docs/crio.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +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
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.

**clean_shutdown_file**="/var/lib/crio/clean.shutdown"
Location for CRI-O to lay down the clean shutdown file.
It is used to check whether crio had time to sync before shutting down.
Expand Down Expand Up @@ -249,6 +253,9 @@ the container runtime configuration.
**pinns_path**=""
The path to find the pinns binary, which is needed to manage namespace lifecycle

**absent_mount_sources_to_reject**=[]
A list of paths that, when absent from the host, will cause a container creation to fail (as opposed to the current behavior of creating a directory).

### CRIO.RUNTIME.RUNTIMES TABLE
The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes. The runtime to use is picked based on the runtime_handler provided by the CRI. If no runtime_handler is provided, the runtime will be picked based on the level of trust of the workload.

Expand Down
27 changes: 16 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ module github.com/cri-o/cri-o

require (
github.com/BurntSushi/toml v0.3.1
github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3
github.com/Microsoft/go-winio v0.5.0
github.com/blang/semver v3.5.1+incompatible
github.com/containerd/containerd v1.5.0-beta.4
github.com/containerd/cgroups v1.0.1
github.com/containerd/containerd v1.5.1
github.com/containerd/ttrpc v1.0.2
github.com/containerd/typeurl v1.0.2
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1
github.com/containers/buildah v1.20.0
github.com/containers/common v0.35.4
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.11.0
github.com/containers/ocicrypt v1.1.0
github.com/containers/image/v5 v5.11.1
github.com/containers/ocicrypt v1.1.1
github.com/containers/podman/v3 v3.1.0
github.com/containers/storage v1.28.1
github.com/containers/storage v1.32.3
github.com/coreos/go-systemd/v22 v22.3.1
github.com/cpuguy83/go-md2man v1.0.10
github.com/creack/pty v1.1.11
github.com/cri-o/ocicni v0.2.1-0.20210301205850-541cf7c703cf
github.com/cri-o/ocicni v0.2.1-0.20210623033107-4ea5fb8752cf
github.com/cyphar/filepath-securejoin v0.2.2
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/go-units v0.4.0
Expand All @@ -33,15 +35,15 @@ require (
github.com/google/renameio v1.0.0
github.com/google/uuid v1.2.0
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/json-iterator/go v1.1.10
github.com/json-iterator/go v1.1.11
github.com/onsi/ginkgo v1.15.2
github.com/onsi/gomega v1.11.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20200206005212-79b036d80240
github.com/opencontainers/runc v1.0.0-rc93
github.com/opencontainers/runtime-spec v1.0.3-0.20201121164853-7413a7f753e1
github.com/opencontainers/runc v1.0.0-rc95.0.20210521141834-a95237f81684
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/opencontainers/runtime-tools v0.9.1-0.20200121211434-d1bf3e66ff0a
github.com/opencontainers/selinux v1.8.0
github.com/opencontainers/selinux v1.9.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.10.0
github.com/psampaz/go-mod-outdated v0.7.0
Expand All @@ -53,7 +55,7 @@ require (
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210324051608-47abb6519492
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887
google.golang.org/grpc v1.37.0
k8s.io/api v0.21.0
k8s.io/apimachinery v0.21.0
Expand All @@ -69,6 +71,9 @@ require (
replace (
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20201121164853-7413a7f753e1
// Pinning the syndtr/gocapability until https://github.com/opencontainers/runc/commit/6dfbe9b80707b1ca188255e8def15263348e0f9a
// is included in the runc release
github.com/syndtr/gocapability => github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24
google.golang.org/grpc => google.golang.org/grpc v1.27.0
k8s.io/api => k8s.io/kubernetes/staging/src/k8s.io/api v0.0.0-20210408162405-cb303e613a12
Expand Down
Loading