mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
Fixup test after Image → ImageConfig split.
The syntax used for the yaml definitions is changed by the need to include the substruct in the struct literal. For the label switch to `ImageConfig` directly, which is actually more correct in that it avoids spurious `name` and `image` fields in the label. Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
parent
aec82c4cdf
commit
f9893d9a9b
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupInspect(t *testing.T, label Image) types.ImageInspect {
|
func setupInspect(t *testing.T, label ImageConfig) types.ImageInspect {
|
||||||
var inspect types.ImageInspect
|
var inspect types.ImageInspect
|
||||||
var config container.Config
|
var config container.Config
|
||||||
|
|
||||||
@ -30,14 +30,16 @@ func TestOverrides(t *testing.T) {
|
|||||||
var yamlCaps = []string{"CAP_SYS_ADMIN"}
|
var yamlCaps = []string{"CAP_SYS_ADMIN"}
|
||||||
|
|
||||||
var yaml = Image{
|
var yaml = Image{
|
||||||
Name: "test",
|
Name: "test",
|
||||||
Image: "testimage",
|
Image: "testimage",
|
||||||
Capabilities: &yamlCaps,
|
ImageConfig: ImageConfig{
|
||||||
|
Capabilities: &yamlCaps,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var labelCaps = []string{"CAP_SYS_CHROOT"}
|
var labelCaps = []string{"CAP_SYS_CHROOT"}
|
||||||
|
|
||||||
var label = Image{
|
var label = ImageConfig{
|
||||||
Capabilities: &labelCaps,
|
Capabilities: &labelCaps,
|
||||||
Cwd: "/label/directory",
|
Cwd: "/label/directory",
|
||||||
}
|
}
|
||||||
@ -66,7 +68,7 @@ func TestInvalidCap(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
labelCaps := []string{"NOT_A_CAP"}
|
labelCaps := []string{"NOT_A_CAP"}
|
||||||
var label = Image{
|
var label = ImageConfig{
|
||||||
Capabilities: &labelCaps,
|
Capabilities: &labelCaps,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,11 +89,13 @@ func TestIdMap(t *testing.T) {
|
|||||||
yaml := Image{
|
yaml := Image{
|
||||||
Name: "test",
|
Name: "test",
|
||||||
Image: "testimage",
|
Image: "testimage",
|
||||||
UID: &uid,
|
ImageConfig: ImageConfig{
|
||||||
GID: &gid,
|
UID: &uid,
|
||||||
|
GID: &gid,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var label = Image{}
|
var label = ImageConfig{}
|
||||||
|
|
||||||
inspect := setupInspect(t, label)
|
inspect := setupInspect(t, label)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user