runsc: remove cilium as a dependency unless built with --define=gotags=xdp

XDP isn't currently being used or developed, so it's best to reduce external
dependencies.

PiperOrigin-RevId: 678786045
This commit is contained in:
Kevin Krakauer
2024-09-25 11:43:46 -07:00
committed by gVisor bot
parent 2d0a6f7865
commit 90faaeb34f
3 changed files with 53 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ go_library(
"memory.go",
"network.go",
"network_unsafe.go",
"no_xdp.go",
"sandbox.go",
"sandbox_impl.go",
"xdp.go",
+45
View File
@@ -0,0 +1,45 @@
// Copyright 2024 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !xdp
// +build !xdp
package sandbox
import (
"errors"
"net"
"os"
"gvisor.dev/gvisor/pkg/urpc"
"gvisor.dev/gvisor/runsc/config"
)
// This file holds placeholders for XDP support, which is not compiled in by default.
//
// To enable XDP support, build gVisor with `--define=gotags=xdp`.
const noXDPMsg = "XDP support was not built into this release -- rebuild with --define=gotags=xdp"
func createRedirectInterfacesAndRoutes(conn *urpc.Client, conf *config.Config) error {
return errors.New(noXDPMsg)
}
func createSocketXDP(iface net.Interface) ([]*os.File, error) {
return nil, errors.New(noXDPMsg)
}
func createXDPTunnel(conn *urpc.Client, nsPath string, conf *config.Config) error {
return errors.New(noXDPMsg)
}
+7
View File
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build xdp
// +build xdp
package sandbox
import (
@@ -34,6 +37,10 @@ import (
xdpcmd "gvisor.dev/gvisor/tools/xdp/cmd"
)
// This file supports XDP in gVisor. It is not compiled in by default.
//
// To enable XDP support, build gVisor with `--define=gotags=xdp`.
// createRedirectInterfacesAndRoutes initializes the network using an AF_XDP
// socket on a *host* device, not a device in the container netns. It:
//