mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-18 12:06:36 +00:00
Compare commits
2 Commits
0.18.0
...
override-r
Author | SHA1 | Date | |
---|---|---|---|
a4c1995587 | |||
5a7a5b2d6d |
@ -42,7 +42,7 @@ const (
|
||||
defaultBridgeName = "openfaas0"
|
||||
|
||||
// defaultSubnet is the default subnet used in the defaultCNIConf -- this value is set to not collide with common container networking subnets:
|
||||
defaultSubnet = "10.62.0.0/16"
|
||||
defaultSubnet = "10.63.0.0/16"
|
||||
|
||||
// defaultIfPrefix is the interface name to be created in the container
|
||||
defaultIfPrefix = "eth"
|
||||
@ -179,7 +179,7 @@ func GetIPAddress(container string, PID uint32) (string, error) {
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// /var/run/cni/openfaas-cni-bridge/10.62.0.2
|
||||
// /var/run/cni/openfaas-cni-bridge/10.63.0.2
|
||||
//
|
||||
// nats-621
|
||||
// eth1
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
func Test_isCNIResultForPID_Found(t *testing.T) {
|
||||
body := `nats-621
|
||||
eth1`
|
||||
fileName := `10.62.0.2`
|
||||
fileName := `10.63.0.2`
|
||||
container := "nats"
|
||||
PID := uint32(621)
|
||||
fullPath := filepath.Join(os.TempDir(), fileName)
|
||||
@ -38,7 +38,7 @@ eth1`
|
||||
func Test_isCNIResultForPID_NoMatch(t *testing.T) {
|
||||
body := `nats-621
|
||||
eth1`
|
||||
fileName := `10.62.0.3`
|
||||
fileName := `10.63.0.3`
|
||||
container := "gateway"
|
||||
PID := uint32(621)
|
||||
fullPath := filepath.Join(os.TempDir(), fileName)
|
||||
|
@ -140,10 +140,7 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
||||
memory.Limit = &v
|
||||
}
|
||||
|
||||
container, err := client.NewContainer(
|
||||
ctx,
|
||||
name,
|
||||
containerd.WithImage(image),
|
||||
ctrOps := []containerd.NewContainerOpts{containerd.WithImage(image),
|
||||
containerd.WithSnapshotter(snapshotter),
|
||||
containerd.WithNewSnapshot(name+"-snapshot", image),
|
||||
containerd.WithNewSpec(oci.WithImageConfig(image),
|
||||
@ -151,8 +148,18 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
||||
oci.WithCapabilities([]string{"CAP_NET_RAW"}),
|
||||
oci.WithMounts(mounts),
|
||||
oci.WithEnv(envs),
|
||||
oci.WithLinuxDevice("/dev/kvm", "rmw"),
|
||||
withMemory(memory)),
|
||||
containerd.WithContainerLabels(labels),
|
||||
containerd.WithContainerLabels(labels)}
|
||||
|
||||
if v, ok := os.LookupEnv("FUNCTION_RUNTIME"); ok && len(v) > 0 {
|
||||
ctrOps = append(ctrOps, containerd.WithRuntime(v, nil))
|
||||
}
|
||||
|
||||
container, err := client.NewContainer(
|
||||
ctx,
|
||||
name,
|
||||
ctrOps...,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user