-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packages: enable
seccomp
in containerd
- Loading branch information
Showing
6 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,16 @@ export GOPATH=$GO_BUILD_PATH:%{gopath} | |
%define gobuild(o:) %{expand: | ||
%global _dwz_low_mem_die_limit 0 | ||
%ifnarch ppc64 | ||
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; | ||
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-seccomp}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; | ||
%else | ||
go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; | ||
go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-seccomp}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**}; | ||
%endif | ||
} | ||
%endif | ||
|
||
|
||
Name: containerd | ||
Release: 1%{?dist} | ||
Release: 2%{?dist} | ||
Summary: An industry-standard container runtime | ||
License: ASL 2.0 | ||
URL: https://containerd.io | ||
|
@@ -43,6 +43,7 @@ Source2: containerd.toml | |
BuildRequires: golang >= 1.10 | ||
BuildRequires: btrfs-progs-devel | ||
BuildRequires: go-md2man | ||
BuildRequires: libseccomp-devel | ||
BuildRequires: systemd | ||
%{?systemd_requires} | ||
Requires: runc | ||
|
@@ -209,6 +210,9 @@ install -D -p -m 0644 %{S:2} %{buildroot}%{_sysconfdir}/containerd/config.toml | |
|
||
|
||
%changelog | ||
* Mon Apr 6 2020 Nicolas Trangez <[email protected]> - 1.2.13-2 | ||
- Enable seccomp support | ||
|
||
* Mon Apr 6 2020 Nicolas Trangez <[email protected]> - 1.2.13-1 | ||
- Latest upstream | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@post @ci @local @seccomp | ||
Feature: seccomp | ||
Scenario: Running a Pod with the 'runtime/default' seccomp profile works | ||
Given the Kubernetes API is available | ||
When we create a utils Pod with labels {'test': 'seccomp1'} and annotations {'seccomp.security.alpha.kubernetes.io/pod': 'runtime/default'} | ||
Then pods with label 'test=seccomp1' are 'Ready' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import os.path | ||
|
||
import yaml | ||
|
||
from kubernetes import client | ||
|
||
import pytest | ||
from pytest_bdd import scenario, when | ||
|
||
from tests import kube_utils | ||
from tests import utils | ||
|
||
|
||
@scenario("../features/seccomp.feature", | ||
"Running a Pod with the 'runtime/default' seccomp profile works") | ||
def test_seccomp(host): | ||
pass | ||
|
||
|
||
@when("we create a utils Pod with labels {'test': 'seccomp1'} " | ||
"and annotations " | ||
"{'seccomp.security.alpha.kubernetes.io/pod': 'runtime/default'}") | ||
def create_utils_pod(utils_pod): | ||
pass | ||
|
||
|
||
@pytest.fixture | ||
def utils_pod(k8s_client, utils_image): | ||
manifest_file = os.path.join( | ||
os.path.realpath(os.path.dirname(__file__)), | ||
"files", | ||
"utils.yaml" | ||
) | ||
with open(manifest_file, encoding="utf-8") as fd: | ||
manifest = yaml.safe_load(fd) | ||
|
||
pod_name = 'test-seccomp1' | ||
|
||
manifest["spec"]["containers"][0]["image"] = utils_image | ||
manifest["metadata"]["name"] = pod_name | ||
manifest["metadata"]["annotations"] = { | ||
"seccomp.security.alpha.kubernetes.io/pod": "runtime/default", | ||
} | ||
manifest["metadata"]["labels"] = { | ||
"test": "seccomp1", | ||
} | ||
|
||
k8s_client.create_namespaced_pod(body=manifest, namespace='default') | ||
|
||
try: | ||
yield pod_name | ||
finally: | ||
k8s_client.delete_namespaced_pod( | ||
name=pod_name, | ||
namespace="default", | ||
body=client.V1DeleteOptions( | ||
grace_period_seconds=0, | ||
), | ||
) |