Skip to content

Commit 45d85c9

Browse files
committed
Update containerd to 06b9cb35161009dcb7123345749fef02f7cea8e0
This also update: - runc to 3f2f8b84a77f73d38244dd690525642a72156c64 - runtime-specs to v1.0.0 Signed-off-by: Kenfe-Mickael Laventure <[email protected]>
1 parent 361a473 commit 45d85c9

47 files changed

Lines changed: 718 additions & 574 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

daemon/daemon_solaris.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ const (
3939
)
4040

4141
func getMemoryResources(config containertypes.Resources) specs.CappedMemory {
42-
memory := specs.CappedMemory{}
42+
memory := specs.CappedMemory{
43+
DisableOOMKiller: config.OomKillDisable,
44+
}
4345

4446
if config.Memory > 0 {
4547
memory.Physical = strconv.FormatInt(config.Memory, 10)

daemon/daemon_unix.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,15 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory {
6868
memory := specs.LinuxMemory{}
6969

7070
if config.Memory > 0 {
71-
limit := uint64(config.Memory)
72-
memory.Limit = &limit
71+
memory.Limit = &config.Memory
7372
}
7473

7574
if config.MemoryReservation > 0 {
76-
reservation := uint64(config.MemoryReservation)
77-
memory.Reservation = &reservation
75+
memory.Reservation = &config.MemoryReservation
7876
}
7977

8078
if config.MemorySwap > 0 {
81-
swap := uint64(config.MemorySwap)
82-
memory.Swap = &swap
79+
memory.Swap = &config.MemorySwap
8380
}
8481

8582
if config.MemorySwappiness != nil {
@@ -88,8 +85,7 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory {
8885
}
8986

9087
if config.KernelMemory != 0 {
91-
kernelMemory := uint64(config.KernelMemory)
92-
memory.Kernel = &kernelMemory
88+
memory.Kernel = &config.KernelMemory
9389
}
9490

9591
return &memory

daemon/oci_linux.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func setResources(s *specs.Spec, r containertypes.Resources) error {
7373
ThrottleReadIOPSDevice: readIOpsDevice,
7474
ThrottleWriteIOPSDevice: writeIOpsDevice,
7575
},
76-
DisableOOMKiller: r.OomKillDisable,
7776
Pids: &specs.LinuxPids{
7877
Limit: r.PidsLimit,
7978
},
@@ -157,14 +156,14 @@ func setDevices(s *specs.Spec, c *container.Container) error {
157156
}
158157

159158
func setRlimits(daemon *Daemon, s *specs.Spec, c *container.Container) error {
160-
var rlimits []specs.LinuxRlimit
159+
var rlimits []specs.POSIXRlimit
161160

162161
// We want to leave the original HostConfig alone so make a copy here
163162
hostConfig := *c.HostConfig
164163
// Merge with the daemon defaults
165164
daemon.mergeUlimits(&hostConfig)
166165
for _, ul := range hostConfig.Ulimits {
167-
rlimits = append(rlimits, specs.LinuxRlimit{
166+
rlimits = append(rlimits, specs.POSIXRlimit{
168167
Type: "RLIMIT_" + strings.ToUpper(ul.Name),
169168
Soft: uint64(ul.Soft),
170169
Hard: uint64(ul.Hard),
@@ -631,7 +630,7 @@ func (daemon *Daemon) populateCommonSpec(s *specs.Spec, c *container.Container)
631630
if err != nil {
632631
return err
633632
}
634-
s.Root = specs.Root{
633+
s.Root = &specs.Root{
635634
Path: c.BaseFS,
636635
Readonly: c.HostConfig.ReadonlyRootfs,
637636
}
@@ -708,7 +707,6 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
708707
if err := setResources(&s, c.HostConfig.Resources); err != nil {
709708
return nil, fmt.Errorf("linux runtime spec resources: %v", err)
710709
}
711-
s.Linux.Resources.OOMScoreAdj = &c.HostConfig.OomScoreAdj
712710
s.Linux.Sysctl = c.HostConfig.Sysctls
713711

714712
p := s.Linux.CgroupsPath
@@ -832,6 +830,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
832830
}
833831
s.Process.SelinuxLabel = c.GetProcessLabel()
834832
s.Process.NoNewPrivileges = c.NoNewPrivileges
833+
s.Process.OOMScoreAdj = &c.HostConfig.OomScoreAdj
835834
s.Linux.MountLabel = c.MountLabel
836835

837836
return (*specs.Spec)(&s), nil

hack/dockerfile/binaries-commits

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
44

55
# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly
6-
RUNC_COMMIT=2d41c047c83e09a6d61d464906feb2a2f3c52aa4
7-
CONTAINERD_COMMIT=3addd840653146c90a254301d6c3a663c7fd6429
6+
RUNC_COMMIT=3f2f8b84a77f73d38244dd690525642a72156c64
7+
CONTAINERD_COMMIT=06b9cb35161009dcb7123345749fef02f7cea8e0
88
TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574
99
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e
1010
VNDR_COMMIT=9909bb2b8a0b7ea464527b376dc50389c90df587

hack/dockerfile/install-binaries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}"
2020

2121
install_runc() {
2222
echo "Install runc version $RUNC_COMMIT"
23-
git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc"
23+
git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
2424
cd "$GOPATH/src/github.com/opencontainers/runc"
2525
git checkout -q "$RUNC_COMMIT"
2626
make BUILDTAGS="$RUNC_BUILDTAGS" $1

hack/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ VERSION=$(< ./VERSION)
7171
! BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
7272
if [ "$DOCKER_GITCOMMIT" ]; then
7373
GITCOMMIT="$DOCKER_GITCOMMIT"
74-
elif command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; then
74+
elif command -v git &> /dev/null && [ -e .git ] && git rev-parse &> /dev/null; then
7575
GITCOMMIT=$(git rev-parse --short HEAD)
7676
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
7777
GITCOMMIT="$GITCOMMIT-unsupported"

libcontainerd/types_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Process struct {
2121
// Capabilities are linux capabilities that are kept for the container.
2222
Capabilities []string `json:"capabilities,omitempty"`
2323
// Rlimits specifies rlimit options to apply to the process.
24-
Rlimits []specs.LinuxRlimit `json:"rlimits,omitempty"`
24+
Rlimits []specs.POSIXRlimit `json:"rlimits,omitempty"`
2525
// ApparmorProfile specifies the apparmor profile for the container.
2626
ApparmorProfile *string `json:"apparmorProfile,omitempty"`
2727
// SelinuxLabel specifies the selinux context that the container process is run as.

libcontainerd/utils_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func systemPid(ctr *containerd.Container) uint32 {
4343
return pid
4444
}
4545

46-
func convertRlimits(sr []specs.LinuxRlimit) (cr []*containerd.Rlimit) {
46+
func convertRlimits(sr []specs.POSIXRlimit) (cr []*containerd.Rlimit) {
4747
for _, r := range sr {
4848
cr = append(cr, &containerd.Rlimit{
4949
Type: r.Type,

oci/defaults.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ func DefaultOSSpec(osName string) specs.Spec {
5050
func DefaultWindowsSpec() specs.Spec {
5151
return specs.Spec{
5252
Version: specs.Version,
53-
Platform: specs.Platform{
54-
OS: runtime.GOOS,
55-
Arch: runtime.GOARCH,
56-
},
5753
Windows: &specs.Windows{},
5854
}
5955
}
@@ -62,10 +58,6 @@ func DefaultWindowsSpec() specs.Spec {
6258
func DefaultSolarisSpec() specs.Spec {
6359
s := specs.Spec{
6460
Version: "0.6.0",
65-
Platform: specs.Platform{
66-
OS: "SunOS",
67-
Arch: runtime.GOARCH,
68-
},
6961
}
7062
s.Solaris = &specs.Solaris{}
7163
return s
@@ -75,10 +67,7 @@ func DefaultSolarisSpec() specs.Spec {
7567
func DefaultLinuxSpec() specs.Spec {
7668
s := specs.Spec{
7769
Version: specs.Version,
78-
Platform: specs.Platform{
79-
OS: "linux",
80-
Arch: runtime.GOARCH,
81-
},
70+
Process: &specs.Process{},
8271
}
8372
s.Mounts = []specs.Mount{
8473
{

plugin/v2/plugin_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
// InitSpec creates an OCI spec from the plugin's config.
1919
func (p *Plugin) InitSpec(execRoot string) (*specs.Spec, error) {
2020
s := oci.DefaultSpec()
21-
s.Root = specs.Root{
21+
s.Root = &specs.Root{
2222
Path: p.Rootfs,
2323
Readonly: false, // TODO: all plugins should be readonly? settable in config?
2424
}

0 commit comments

Comments
 (0)