kubelet: change map[string]RuntimeHandler to []RuntimeHandler

The map is changed to an array so as to retain the order of the original array
propagated from the CRI runtime.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2024-03-09 09:48:07 +09:00
parent d3d06c3c7e
commit 27f24a62e3
5 changed files with 17 additions and 16 deletions

View File

@@ -109,13 +109,13 @@ func TestHandlerSupportsUserNamespaces(t *testing.T) {
defer testKubelet.Cleanup()
kubelet := testKubelet.kubelet
kubelet.runtimeState.setRuntimeHandlers(map[string]kubecontainer.RuntimeHandler{
"has-support": {
kubelet.runtimeState.setRuntimeHandlers([]kubecontainer.RuntimeHandler{
{
Name: "has-support",
SupportsUserNamespaces: true,
},
"has-no-support": {
Name: "has-support",
{
Name: "has-no-support",
SupportsUserNamespaces: false,
},
})