@@ -72,7 +72,8 @@ func getCreateContainerTestData() (*runtime.ContainerConfig, *runtime.PodSandbox
7272 MemoryLimitInBytes : 400 ,
7373 },
7474 SecurityContext : & runtime.WindowsContainerSecurityContext {
75- RunAsUsername : "test-user" ,
75+ RunAsUsername : "test-user" ,
76+ CredentialSpec : "{\" test\" : \" spec\" }" ,
7677 },
7778 },
7879 }
@@ -91,6 +92,7 @@ func getCreateContainerTestData() (*runtime.ContainerConfig, *runtime.PodSandbox
9192 Entrypoint : []string {"/entrypoint" },
9293 Cmd : []string {"cmd" },
9394 WorkingDir : "/workspace" ,
95+ User : "ContainerUser" ,
9496 }
9597 specCheck := func (t * testing.T , id string , sandboxID string , sandboxPid uint32 , spec * runtimespec.Spec ) {
9698 assert .Nil (t , spec .Root )
@@ -111,9 +113,13 @@ func getCreateContainerTestData() (*runtime.ContainerConfig, *runtime.PodSandbox
111113 assert .EqualValues (t , * spec .Windows .Resources .CPU .Maximum , 300 )
112114 assert .EqualValues (t , * spec .Windows .Resources .Memory .Limit , 400 )
113115
116+ // Also checks if override of the image configs user is behaving.
114117 t .Logf ("Check username" )
115118 assert .Contains (t , spec .Process .User .Username , "test-user" )
116119
120+ t .Logf ("Check credential spec" )
121+ assert .Contains (t , spec .Windows .CredentialSpec , "{\" test\" : \" spec\" }" )
122+
117123 t .Logf ("Check PodSandbox annotations" )
118124 assert .Contains (t , spec .Annotations , annotations .SandboxID )
119125 assert .EqualValues (t , spec .Annotations [annotations .SandboxID ], sandboxID )
0 commit comments