diff --git a/CHANGELOG.md b/CHANGELOG.md index e32f1067..d3891659 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +### 12.116.0 + +- `[support]` Added Yandex Serverless support +- `[system/container]` Added Yandex Serverless support + ### 12.115.0 - `[knf/united]` Added method `GetMapping` diff --git a/ek.go b/ek.go index 380219c6..1af0080d 100644 --- a/ek.go +++ b/ek.go @@ -21,7 +21,7 @@ import ( // ////////////////////////////////////////////////////////////////////////////////// // // VERSION is current ek package version -const VERSION = "12.115.0" +const VERSION = "12.116.0" // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/support/support_nix.go b/support/support_nix.go index 177077a3..230ad568 100644 --- a/support/support_nix.go +++ b/support/support_nix.go @@ -265,6 +265,8 @@ func (i *Info) printOSInfo() { format(12, true, "Container", "Yes (Podman)") case "lxc": format(12, true, "Container", "Yes (LXC)") + case "yandex": + format(12, true, "Container", "Yes (Yandex Serverless)") } } } diff --git a/support/support_test.go b/support/support_test.go index 2b24732d..af30b9ee 100644 --- a/support/support_test.go +++ b/support/support_test.go @@ -110,6 +110,8 @@ func (s *SupportSuite) TestCollect(c *C) { i.printOSInfo() i.System.ContainerEngine = "lxc" i.printOSInfo() + i.System.ContainerEngine = "yandex" + i.printOSInfo() } func (s *SupportSuite) TestNil(c *C) { diff --git a/system/container/container.go b/system/container/container.go index bfcf6abc..9a423a8f 100644 --- a/system/container/container.go +++ b/system/container/container.go @@ -19,6 +19,7 @@ const ( DOCKER = "docker" // Docker (Moby) PODMAN = "podman" // Podman LXC = "lxc" // LXC + YANDEX = "yandex" // Yandex Serverless ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -64,6 +65,8 @@ func IsContainer() bool { // guessEngine tries to guess container engine based on information from /proc/1/mounts func guessEngine(mountsData string) string { switch { + case strings.Contains(mountsData, "overlay-container /function/code/rootfs"): + return YANDEX case strings.Contains(mountsData, "lxcfs "): return LXC case strings.Contains(mountsData, "workdir=/var/lib/containers"): diff --git a/system/container/container_test.go b/system/container/container_test.go index ff8d4124..6bceb867 100644 --- a/system/container/container_test.go +++ b/system/container/container_test.go @@ -36,6 +36,10 @@ proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 devtmpfs /dev devtmpfs rw,nosuid,size=930048k,nr_inodes=232512,mode=755 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0`), 0644) + os.WriteFile(s.DataDir+"/yandex", []byte(`overlay-container /function/code/rootfs overlay rw,relatime,lowerdir=/function/code/3c854c8cbf469fda815b8f6183300c07cfa2fbb5703859ca79aff93ae934961b,upperdir=/tmp/.overlay/tmp/diff,workdir=/tmp/.overlay/tmp/work 0 0 +devtmpfs /function/code/rootfs/dev devtmpfs rw,relatime,size=18464k,nr_inodes=4616,mode=755 0 0 +/var/run /function/code/rootfs/etc/resolv.conf tmpfs rw,relatime,size=20400k,nr_inodes=5100 0 0`), 0644) + os.WriteFile(s.DataDir+"/lxc", []byte(`none /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime 0 0 lxcfs /proc/cpuinfo fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0`), 0644) @@ -60,6 +64,11 @@ func (s *ContainerSuite) TestGetEngine(c *C) { engineChecked = false + mountsFile = s.DataDir + "/yandex" + c.Assert(GetEngine(), Equals, YANDEX) + + engineChecked = false + mountsFile = s.DataDir + "/lxc" c.Assert(GetEngine(), Equals, LXC)