Skip to content

Commit

Permalink
Merge pull request #3599 from cevich/update_to_f35
Browse files Browse the repository at this point in the history
Cirrus: Bump up to Fedora 35 & Ubuntu 21.10
  • Loading branch information
openshift-merge-robot authored Nov 18, 2021
2 parents 4c40e8e + 0b3e75a commit b71ccf3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 76 deletions.
11 changes: 4 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ env:
####
# GCE project where images live
IMAGE_PROJECT: "libpod-218412"
FEDORA_NAME: "fedora-34"
PRIOR_FEDORA_NAME: "fedora-33"
UBUNTU_NAME: "ubuntu-2104"
FEDORA_NAME: "fedora-35"
PRIOR_FEDORA_NAME: "fedora-34"
UBUNTU_NAME: "ubuntu-2110"

IMAGE_SUFFIX: "c6431352024203264"
IMAGE_SUFFIX: "c6226133906620416"
FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}"
PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${IMAGE_SUFFIX}"
UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}"
Expand Down Expand Up @@ -216,9 +216,6 @@ static_build_task:
init_script: |
set -ex
setenforce 0
growpart /dev/sda 1 || true
resize2fs /dev/sda1 || true
yum -y install podman
nix_cache:
folder: '.cache'
Expand Down
3 changes: 3 additions & 0 deletions chroot/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func testMinimal(t *testing.T, modify func(g *generate.Generator, rootDir, bundl
if err != nil {
t.Fatalf("generate.New(%q): %v", "linux", err)
}
if err = setupSeccomp(g.Config, ""); err != nil {
t.Fatalf("setupSeccomp(%q): %v", "", err)
}

tempDir, err := ioutil.TempDir("", "chroot-test")
if err != nil {
Expand Down
27 changes: 27 additions & 0 deletions chroot/seccomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
package chroot

import (
"io/ioutil"

"github.com/containers/common/pkg/seccomp"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
libseccomp "github.com/seccomp/libseccomp-golang"
Expand Down Expand Up @@ -171,3 +174,27 @@ func setSeccomp(spec *specs.Spec) error {
}
return nil
}

func setupSeccomp(spec *specs.Spec, seccompProfilePath string) error {
switch seccompProfilePath {
case "unconfined":
spec.Linux.Seccomp = nil
case "":
seccompConfig, err := seccomp.GetDefaultProfile(spec)
if err != nil {
return errors.Wrapf(err, "loading default seccomp profile failed")
}
spec.Linux.Seccomp = seccompConfig
default:
seccompProfile, err := ioutil.ReadFile(seccompProfilePath)
if err != nil {
return errors.Wrapf(err, "opening seccomp profile (%s) failed", seccompProfilePath)
}
seccompConfig, err := seccomp.LoadProfile(string(seccompProfile), spec)
if err != nil {
return errors.Wrapf(err, "loading seccomp profile (%s) failed", seccompProfilePath)
}
spec.Linux.Seccomp = seccompConfig
}
return nil
}
8 changes: 8 additions & 0 deletions chroot/seccomp_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ func setSeccomp(spec *specs.Spec) error {
}
return nil
}

func setupSeccomp(spec *specs.Spec, seccompProfilePath string) error {
if spec.Linux != nil {
// runtime-tools may have supplied us with a default filter
spec.Linux.Seccomp = nil
}
return nil
}
63 changes: 0 additions & 63 deletions contrib/cirrus/add_second_partition.sh

This file was deleted.

6 changes: 0 additions & 6 deletions contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ echo "Setting up $OS_RELEASE_ID $OS_RELEASE_VER"
cd $GOSRC
case "$OS_RELEASE_ID" in
fedora)
# Not executing IN_PODMAN container
if [[ -z "$CONTAINER" ]]; then
warn "Adding secondary testing partition & growing root filesystem"
bash $SCRIPT_BASE/add_second_partition.sh
fi

warn "Hard-coding podman to use crun"
cat > /etc/containers/containers.conf <<EOF
[engine]
Expand Down

0 comments on commit b71ccf3

Please sign in to comment.