Keep host order as defined in TOML file

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-04-01 09:29:16 -07:00
parent 6866b36ab6
commit 5ada2f74a7
3 changed files with 48 additions and 15 deletions

View File

@@ -26,8 +26,6 @@ import (
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/containerd/containerd/log/logtest"
"github.com/containerd/containerd/remotes/docker"
)
@@ -181,7 +179,15 @@ ca = "/etc/path/default"
}
}()
assert.ElementsMatch(t, expected, hosts)
if len(hosts) != len(expected) {
t.Fatalf("Unexpected number of hosts %d, expected %d", len(hosts), len(expected))
}
for i := range hosts {
if !compareHostConfig(hosts[i], expected[i]) {
t.Fatalf("Mismatch at host %d", i)
}
}
}
func TestLoadCertFiles(t *testing.T) {