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_JSONFILE': ENV['GOTESTSUM_JSONFILE'],
|
||||
'GITHUB_WORKSPACE': '',
|
||||
'DISABLE_CRI_SANDBOXES': ENV['DISABLE_CRI_SANDBOXES'],
|
||||
}
|
||||
sh.inline = <<~SHELL
|
||||
#!/usr/bin/env bash
|
||||
|
@ -18,8 +18,6 @@ Documentation=https://containerd.io
|
||||
After=network.target local-fs.target
|
||||
|
||||
[Service]
|
||||
#uncomment to fallback to legacy CRI plugin implementation with podsandbox support.
|
||||
#Environment="DISABLE_CRI_SANDBOXES=1"
|
||||
ExecStartPre=-/sbin/modprobe overlay
|
||||
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
|
||||
# The test scripts need these env vars to be explicitly set
|
||||
ENV GITHUB_WORKSPACE=""
|
||||
ENV DISABLE_CRI_SANDBOXES=""
|
||||
ENV CONTAINERD_RUNTIME="io.containerd.runc.v2"
|
||||
CMD ["make", "cri-integration"]
|
||||
|
||||
|
@ -31,15 +31,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
criapiv1 "k8s.io/cri-api/pkg/apis/runtime/v1"
|
||||
|
||||
"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/typeurl/v2"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -293,33 +290,6 @@ func TestRunPodSandboxAndTeardownCNISlow(t *testing.T) {
|
||||
assert.Equal(t, sbConfig.Metadata.Uid, sb.Metadata.Uid)
|
||||
assert.Equal(t, sbConfig.Metadata.Attempt, sb.Metadata.Attempt)
|
||||
|
||||
if os.Getenv("DISABLE_CRI_SANDBOXES") != "" {
|
||||
// non-sbserver
|
||||
t.Log("Get sandbox info (non-sbserver)")
|
||||
_, info, err := SandboxInfo(sb.Id)
|
||||
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")
|
||||
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)
|
||||
@ -327,7 +297,6 @@ func TestRunPodSandboxAndTeardownCNISlow(t *testing.T) {
|
||||
|
||||
assert.NotEmpty(t, info.Metadata.NetNSPath, "network namespace should be set")
|
||||
}
|
||||
}
|
||||
|
||||
// sbserverSandboxInfo gets sandbox info.
|
||||
func sbserverSandboxInfo(id string) (*criapiv1.PodSandboxStatus, *podsandbox.SandboxInfo, error) {
|
||||
|
@ -44,10 +44,6 @@ test_setup "${REPORT_DIR}"
|
||||
CMD=""
|
||||
if [ -n "${sudo}" ]; then
|
||||
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
|
||||
CMD+="${PWD}/bin/cri-integration.test"
|
||||
|
||||
|
@ -222,10 +222,6 @@ run_containerd() {
|
||||
CMD=""
|
||||
if [ -n "${sudo}" ]; then
|
||||
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
|
||||
CMD+="${PWD}/bin/containerd"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user