Take default runtime and snapshotter from namespace labels
Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user