|
|
@ -31,6 +31,14 @@ import (
|
|
|
|
utilpointer "k8s.io/utils/pointer"
|
|
|
|
utilpointer "k8s.io/utils/pointer"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func seccompLocalhostRef(profileName string) string {
|
|
|
|
|
|
|
|
return filepath.Join(fakeSeccompProfileRoot, profileName)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func seccompLocalhostPath(profileName string) string {
|
|
|
|
|
|
|
|
return "localhost/" + seccompLocalhostRef(profileName)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestStableKey(t *testing.T) {
|
|
|
|
func TestStableKey(t *testing.T) {
|
|
|
|
container := &v1.Container{
|
|
|
|
container := &v1.Container{
|
|
|
|
Name: "test_container",
|
|
|
|
Name: "test_container",
|
|
|
@ -353,7 +361,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
annotation: map[string]string{
|
|
|
|
annotation: map[string]string{
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: pod localhost seccomp profile with containerName should return local profile path",
|
|
|
|
description: "annotations: pod localhost seccomp profile with containerName should return local profile path",
|
|
|
@ -361,7 +369,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile with containerName should return local profile path",
|
|
|
|
description: "annotations: container localhost seccomp profile with containerName should return local profile path",
|
|
|
@ -369,7 +377,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile should override pod profile",
|
|
|
|
description: "annotations: container localhost seccomp profile should override pod profile",
|
|
|
@ -378,7 +386,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile with unmatched containerName should return empty",
|
|
|
|
description: "annotations: container localhost seccomp profile with unmatched containerName should return empty",
|
|
|
@ -411,7 +419,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "filename"),
|
|
|
|
expectedProfile: seccompLocalhostPath("filename"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost with empty LocalhostProfile returns empty",
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost with empty LocalhostProfile returns empty",
|
|
|
@ -426,7 +434,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "container seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
description: "container seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "filename2"),
|
|
|
|
expectedProfile: seccompLocalhostPath("filename2"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise container field over pod field",
|
|
|
|
description: "prioritise container field over pod field",
|
|
|
@ -443,7 +451,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "field-cont-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("field-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise container annotation over pod field",
|
|
|
|
description: "prioritise container annotation over pod field",
|
|
|
@ -453,7 +461,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "annota-cont-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("annota-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise pod field over pod annotation",
|
|
|
|
description: "prioritise pod field over pod annotation",
|
|
|
@ -462,7 +470,7 @@ func TestGetSeccompProfilePath(t *testing.T) {
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/annota-pod-profile.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/annota-pod-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "field-pod-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("field-pod-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -543,7 +551,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
annotation: map[string]string{
|
|
|
|
annotation: map[string]string{
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: pod localhost seccomp profile with containerName should return local profile path",
|
|
|
|
description: "annotations: pod localhost seccomp profile with containerName should return local profile path",
|
|
|
@ -551,7 +559,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile with containerName should return local profile path",
|
|
|
|
description: "annotations: container localhost seccomp profile with containerName should return local profile path",
|
|
|
@ -559,7 +567,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile should override pod profile",
|
|
|
|
description: "annotations: container localhost seccomp profile should override pod profile",
|
|
|
@ -568,7 +576,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/chmod.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "chmod.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("chmod.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "annotations: container localhost seccomp profile with unmatched containerName should return runtime/default",
|
|
|
|
description: "annotations: container localhost seccomp profile with unmatched containerName should return runtime/default",
|
|
|
@ -601,7 +609,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "filename"),
|
|
|
|
expectedProfile: seccompLocalhostPath("filename"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost with empty LocalhostProfile returns runtime/default",
|
|
|
|
description: "pod seccomp profile set to SeccompProfileTypeLocalhost with empty LocalhostProfile returns runtime/default",
|
|
|
@ -616,7 +624,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "container seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
description: "container seccomp profile set to SeccompProfileTypeLocalhost returns 'localhost/' + LocalhostProfile",
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "filename2"),
|
|
|
|
expectedProfile: seccompLocalhostPath("filename2"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise container field over pod field",
|
|
|
|
description: "prioritise container field over pod field",
|
|
|
@ -633,7 +641,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "field-cont-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("field-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise container annotation over pod field",
|
|
|
|
description: "prioritise container annotation over pod field",
|
|
|
@ -643,7 +651,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
v1.SeccompContainerAnnotationKeyPrefix + "container1": "localhost/annota-cont-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "annota-cont-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("annota-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
description: "prioritise pod field over pod annotation",
|
|
|
|
description: "prioritise pod field over pod annotation",
|
|
|
@ -652,7 +660,7 @@ func TestGetSeccompProfilePathDefaultSeccomp(t *testing.T) {
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/annota-pod-profile.json",
|
|
|
|
v1.SeccompPodAnnotationKey: "localhost/annota-pod-profile.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: "localhost/" + filepath.Join(fakeSeccompProfileRoot, "field-pod-profile.json"),
|
|
|
|
expectedProfile: seccompLocalhostPath("field-pod-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -711,7 +719,7 @@ func TestGetSeccompProfile(t *testing.T) {
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "filename"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("filename"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -729,7 +737,7 @@ func TestGetSeccompProfile(t *testing.T) {
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "filename2"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("filename2"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -745,7 +753,7 @@ func TestGetSeccompProfile(t *testing.T) {
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "field-cont-profile.json"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("field-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -805,7 +813,7 @@ func TestGetSeccompProfileDefaultSeccomp(t *testing.T) {
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
podSc: &v1.PodSecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename")}},
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "filename"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("filename"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -823,7 +831,7 @@ func TestGetSeccompProfileDefaultSeccomp(t *testing.T) {
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
containerSc: &v1.SecurityContext{SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeLocalhost, LocalhostProfile: getLocal("filename2")}},
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "filename2"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("filename2"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -839,7 +847,7 @@ func TestGetSeccompProfileDefaultSeccomp(t *testing.T) {
|
|
|
|
containerName: "container1",
|
|
|
|
containerName: "container1",
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
expectedProfile: &runtimeapi.SecurityProfile{
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
ProfileType: runtimeapi.SecurityProfile_Localhost,
|
|
|
|
LocalhostRef: filepath.Join(fakeSeccompProfileRoot, "field-cont-profile.json"),
|
|
|
|
LocalhostRef: seccompLocalhostRef("field-cont-profile.json"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|