Take default runtime and snapshotter from namespace labels

Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
This commit is contained in:
Nikhil Soni
2018-09-02 23:33:58 +05:30
parent f7f24e2f3a
commit 59432aaecf
4 changed files with 57 additions and 6 deletions

View File

@@ -393,3 +393,28 @@ func createShimDebugConfig() string {
return f.Name()
}
func TestDefaultRuntimeWithNamespaceLabels(t *testing.T) {
client, err := newClient(t, address)
if err != nil {
t.Fatal(err)
}
defer client.Close()
ctx, cancel := testContext()
defer cancel()
namespaces := client.NamespaceService()
testRuntime := "testRuntime"
if err := namespaces.SetLabel(ctx, testNamespace, "runtime", testRuntime); err != nil {
t.Fatal(err)
}
testClient, err := newClient(t, address, WithDefaultNamespace(testNamespace))
if err != nil {
t.Fatal(err)
}
defer testClient.Close()
if testClient.runtime != testRuntime {
t.Error("failed to set default runtime from namespace labels")
}
}