Skip to content

Commit

Permalink
Do not pull rootless CNI infra image
Browse files Browse the repository at this point in the history
Instead, we want to advise users to manually build the image. We
cannot distribute the existing image for RHEL 8.3.1, and the
feature will be tech preview, so this degraded user experience
will have to be sufficient until we can get a better solution in
place.

Ref: https://issues.redhat.com/browse/RUN-1127

Please note that this is a RHEL only change and should not be
included in non-RHEL branches.

Signed-off-by: Matthew Heon <mheon@redhat.com>
  • Loading branch information
mheon committed Dec 10, 2020
1 parent 26b3357 commit 0a596dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
19 changes: 5 additions & 14 deletions libpod/rootless_cni_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ import (
"context"
"io"
"path/filepath"
"runtime"

cnitypes "github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/containers/podman/v2/libpod/define"
"github.com/containers/podman/v2/libpod/image"
"github.com/containers/podman/v2/pkg/env"
"github.com/containers/podman/v2/pkg/util"
"github.com/containers/storage/pkg/lockfile"
"github.com/hashicorp/go-multierror"
spec "github.com/opencontainers/runtime-spec/specs-go"
Expand All @@ -23,11 +20,6 @@ import (
"github.com/sirupsen/logrus"
)

// Built from ../contrib/rootless-cni-infra.
var rootlessCNIInfraImage = map[string]string{
"amd64": "quay.io/libpod/rootless-cni-infra@sha256:304742d5d221211df4ec672807a5842ff11e3729c50bc424ea0cea858f69d7b7", // 3-amd64
}

const (
rootlessCNIInfraContainerNamespace = "podman-system"
rootlessCNIInfraContainerName = "rootless-cni-infra"
Expand Down Expand Up @@ -233,14 +225,13 @@ func ensureRootlessCNIInfraContainerRunning(ctx context.Context, r *Runtime) (*C
}

func startRootlessCNIInfraContainer(ctx context.Context, r *Runtime) (*Container, error) {
imageName, ok := rootlessCNIInfraImage[runtime.GOARCH]
if !ok {
return nil, errors.Errorf("cannot find rootless-podman-network-sandbox image for %s", runtime.GOARCH)
}
imageName := "rootless-cni-infra"
logrus.Debugf("rootless CNI: ensuring image %q to exist", imageName)
newImage, err := r.ImageRuntime().New(ctx, imageName, "", "", nil, nil,
image.SigningOptions{}, nil, util.PullImageMissing)
newImage, err := r.ImageRuntime().NewFromLocal(imageName)
if err != nil {
if errors.Cause(err) == define.ErrNoSuchImage {
return nil, errors.Errorf("rootless CNI infra image not present - please build image from https://github.com/containers/podman/blob/v2.2.1/contrib/rootless-cni-infra/Containerfile and tag as %q", imageName)
}
return nil, err
}
logrus.Debugf("rootless CNI: image %q is ready", imageName)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var _ = Describe("Podman network", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
SkipIfRootless("rootless CNI is tech preview in 8.3.1")
})

AfterEach(func() {
Expand Down

0 comments on commit 0a596dd

Please sign in to comment.