1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-09 07:42:52 +03:00

Weakly decode backend options (#4577)

This commit is contained in:
qwerty287
2024-12-16 19:37:38 +02:00
committed by GitHub
parent b3c61fa47b
commit 1ec785c7e9
3 changed files with 19 additions and 2 deletions

View File

@@ -114,6 +114,23 @@ func Test_parseBackendOptions(t *testing.T) {
},
},
},
{
name: "number options",
step: &backend.Step{BackendOptions: map[string]any{
"kubernetes": map[string]any{
"resources": map[string]any{
"requests": map[string]int{"memory": 128, "cpu": 1000},
"limits": map[string]int{"memory": 256, "cpu": 2},
},
},
}},
want: BackendOptions{
Resources: Resources{
Requests: map[string]string{"memory": "128", "cpu": "1000"},
Limits: map[string]string{"memory": "256", "cpu": "2"},
},
},
},
}
for _, tt := range tests {