Clean shell scripts
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
fa1d3a9ccb
commit
a3c2c1e4da
1
Vagrantfile
vendored
1
Vagrantfile
vendored
@ -272,7 +272,6 @@ EOF
|
|||||||
'GOTESTSUM_JUNITFILE': ENV['GOTESTSUM_JUNITFILE'],
|
'GOTESTSUM_JUNITFILE': ENV['GOTESTSUM_JUNITFILE'],
|
||||||
'GOTESTSUM_JSONFILE': ENV['GOTESTSUM_JSONFILE'],
|
'GOTESTSUM_JSONFILE': ENV['GOTESTSUM_JSONFILE'],
|
||||||
'GITHUB_WORKSPACE': '',
|
'GITHUB_WORKSPACE': '',
|
||||||
'DISABLE_CRI_SANDBOXES': ENV['DISABLE_CRI_SANDBOXES'],
|
|
||||||
}
|
}
|
||||||
sh.inline = <<~SHELL
|
sh.inline = <<~SHELL
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
@ -18,8 +18,6 @@ Documentation=https://containerd.io
|
|||||||
After=network.target local-fs.target
|
After=network.target local-fs.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
#uncomment to fallback to legacy CRI plugin implementation with podsandbox support.
|
|
||||||
#Environment="DISABLE_CRI_SANDBOXES=1"
|
|
||||||
ExecStartPre=-/sbin/modprobe overlay
|
ExecStartPre=-/sbin/modprobe overlay
|
||||||
ExecStart=/usr/local/bin/containerd
|
ExecStart=/usr/local/bin/containerd
|
||||||
|
|
||||||
|
@ -94,7 +94,6 @@ RUN make BUILDTAGS="no_btrfs no_devmapper" bin/cri-integration.test
|
|||||||
RUN ./script/setup/install-failpoint-binaries
|
RUN ./script/setup/install-failpoint-binaries
|
||||||
# The test scripts need these env vars to be explicitly set
|
# The test scripts need these env vars to be explicitly set
|
||||||
ENV GITHUB_WORKSPACE=""
|
ENV GITHUB_WORKSPACE=""
|
||||||
ENV DISABLE_CRI_SANDBOXES=""
|
|
||||||
ENV CONTAINERD_RUNTIME="io.containerd.runc.v2"
|
ENV CONTAINERD_RUNTIME="io.containerd.runc.v2"
|
||||||
CMD ["make", "cri-integration"]
|
CMD ["make", "cri-integration"]
|
||||||
|
|
||||||
|
@ -31,15 +31,12 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
criapiv1 "k8s.io/cri-api/pkg/apis/runtime/v1"
|
criapiv1 "k8s.io/cri-api/pkg/apis/runtime/v1"
|
||||||
|
|
||||||
"github.com/containerd/containerd/pkg/cri/sbserver/podsandbox"
|
"github.com/containerd/containerd/pkg/cri/sbserver/podsandbox"
|
||||||
"github.com/containerd/containerd/pkg/cri/store/sandbox"
|
|
||||||
"github.com/containerd/containerd/pkg/failpoint"
|
"github.com/containerd/containerd/pkg/failpoint"
|
||||||
"github.com/containerd/typeurl/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -293,40 +290,12 @@ func TestRunPodSandboxAndTeardownCNISlow(t *testing.T) {
|
|||||||
assert.Equal(t, sbConfig.Metadata.Uid, sb.Metadata.Uid)
|
assert.Equal(t, sbConfig.Metadata.Uid, sb.Metadata.Uid)
|
||||||
assert.Equal(t, sbConfig.Metadata.Attempt, sb.Metadata.Attempt)
|
assert.Equal(t, sbConfig.Metadata.Attempt, sb.Metadata.Attempt)
|
||||||
|
|
||||||
if os.Getenv("DISABLE_CRI_SANDBOXES") != "" {
|
t.Log("Get sandbox info (sbserver)")
|
||||||
// non-sbserver
|
_, info, err := sbserverSandboxInfo(sb.Id)
|
||||||
t.Log("Get sandbox info (non-sbserver)")
|
require.NoError(t, err)
|
||||||
_, info, err := SandboxInfo(sb.Id)
|
require.False(t, info.NetNSClosed)
|
||||||
require.NoError(t, err)
|
|
||||||
require.False(t, info.NetNSClosed)
|
|
||||||
var netNS string
|
|
||||||
for _, n := range info.RuntimeSpec.Linux.Namespaces {
|
|
||||||
if n.Type == runtimespec.NetworkNamespace {
|
|
||||||
netNS = n.Path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assert.NotEmpty(t, netNS, "network namespace should be set")
|
|
||||||
|
|
||||||
t.Log("Get sandbox container")
|
assert.NotEmpty(t, info.Metadata.NetNSPath, "network namespace should be set")
|
||||||
c, err := GetContainer(sb.Id)
|
|
||||||
require.NoError(t, err)
|
|
||||||
md, ok := c.Extensions["io.cri-containerd.sandbox.metadata"]
|
|
||||||
require.True(t, ok, "sandbox metadata should exist in extension")
|
|
||||||
i, err := typeurl.UnmarshalAny(md)
|
|
||||||
require.NoError(t, err)
|
|
||||||
require.IsType(t, &sandbox.Metadata{}, i)
|
|
||||||
metadata, ok := i.(*sandbox.Metadata)
|
|
||||||
require.True(t, ok)
|
|
||||||
assert.Equal(t, netNS, metadata.NetNSPath, "network namespace path should be the same in runtime spec and sandbox metadata")
|
|
||||||
} else {
|
|
||||||
// sbserver
|
|
||||||
t.Log("Get sandbox info (sbserver)")
|
|
||||||
_, info, err := sbserverSandboxInfo(sb.Id)
|
|
||||||
require.NoError(t, err)
|
|
||||||
require.False(t, info.NetNSClosed)
|
|
||||||
|
|
||||||
assert.NotEmpty(t, info.Metadata.NetNSPath, "network namespace should be set")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sbserverSandboxInfo gets sandbox info.
|
// sbserverSandboxInfo gets sandbox info.
|
||||||
|
@ -44,10 +44,6 @@ test_setup "${REPORT_DIR}"
|
|||||||
CMD=""
|
CMD=""
|
||||||
if [ -n "${sudo}" ]; then
|
if [ -n "${sudo}" ]; then
|
||||||
CMD+="${sudo} "
|
CMD+="${sudo} "
|
||||||
# sudo strips environment variables, so add DISABLE_CRI_SANDBOXES back if present
|
|
||||||
if [ -n "${DISABLE_CRI_SANDBOXES}" ]; then
|
|
||||||
CMD+="DISABLE_CRI_SANDBOXES='${DISABLE_CRI_SANDBOXES}' "
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
CMD+="${PWD}/bin/cri-integration.test"
|
CMD+="${PWD}/bin/cri-integration.test"
|
||||||
|
|
||||||
|
@ -222,10 +222,6 @@ run_containerd() {
|
|||||||
CMD=""
|
CMD=""
|
||||||
if [ -n "${sudo}" ]; then
|
if [ -n "${sudo}" ]; then
|
||||||
CMD+="${sudo} "
|
CMD+="${sudo} "
|
||||||
# sudo strips environment variables, so add DISABLE_CRI_SANDBOXES back if present
|
|
||||||
if [ -n "${DISABLE_CRI_SANDBOXES}" ]; then
|
|
||||||
CMD+="DISABLE_CRI_SANDBOXES='${DISABLE_CRI_SANDBOXES}' "
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
CMD+="${PWD}/bin/containerd"
|
CMD+="${PWD}/bin/containerd"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user