Switch all our tests to version 2

Also warn when someone uses version 1

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2021-04-11 19:49:37 -04:00
parent 2a2d779594
commit 9ad087947d
8 changed files with 28 additions and 18 deletions

View File

@@ -503,12 +503,12 @@ func createShimDebugConfig() string {
os.Exit(1)
}
defer f.Close()
if _, err := f.WriteString("version = 1\n"); err != nil {
if _, err := f.WriteString("version = 2\n"); err != nil {
fmt.Fprintf(os.Stderr, "Failed to write to config file %s: %s\n", f.Name(), err)
os.Exit(1)
}
if _, err := f.WriteString("[plugins.linux]\n\tshim_debug = true\n"); err != nil {
if _, err := f.WriteString("[plugins.\"io.containerd.runtime.v1.linux\"]\n\tshim_debug = true\n"); err != nil {
fmt.Fprintf(os.Stderr, "Failed to write to config file %s: %s\n", f.Name(), err)
os.Exit(1)
}

View File

@@ -129,9 +129,9 @@ func TestDaemonRuntimeRoot(t *testing.T) {
}
}()
configTOML := `
version = 1
version = 2
[plugins]
[plugins.cri]
[plugins."io.containerd.grpc.v1.cri"]
stream_server_port = "0"
`
@@ -227,7 +227,7 @@ func TestDaemonCustomCgroup(t *testing.T) {
customCgroup := fmt.Sprintf("%d", time.Now().Nanosecond())
configTOML := `
version = 1
version = 2
[cgroup]
path = "` + customCgroup + `"`