@@ -285,7 +285,7 @@ func TestPodExtractContent(t *testing.T) {
285
285
ObjectMeta : metav1.ObjectMeta {
286
286
GenerateName : "test-" ,
287
287
Namespace : "testns" ,
288
- Labels : map [string ]string {"olm.pod-spec-hash" : "5MSUJs07MqD3fl9supmPaRNxD9N6tK8Bjo4OFl " , "olm.managed" : "true" },
288
+ Labels : map [string ]string {"olm.pod-spec-hash" : "r86WYqCuUPyC9whJJfiyFBVtwoKEghJ74gCQO " , "olm.managed" : "true" },
289
289
Annotations : map [string ]string {"cluster-autoscaler.kubernetes.io/safe-to-evict" : "true" },
290
290
},
291
291
Spec : corev1.PodSpec {
@@ -307,6 +307,9 @@ func TestPodExtractContent(t *testing.T) {
307
307
Args : []string {"/bin/copy-content" , "/utilities/copy-content" },
308
308
VolumeMounts : []corev1.VolumeMount {{Name : "utilities" , MountPath : "/utilities" }},
309
309
TerminationMessagePolicy : "FallbackToLogsOnError" ,
310
+ SecurityContext : & corev1.SecurityContext {
311
+ ReadOnlyRootFilesystem : ptr .To (true ),
312
+ },
310
313
},
311
314
{
312
315
Name : "extract-content" ,
@@ -324,6 +327,9 @@ func TestPodExtractContent(t *testing.T) {
324
327
{Name : "catalog-content" , MountPath : "/extracted-catalog" },
325
328
},
326
329
TerminationMessagePolicy : "FallbackToLogsOnError" ,
330
+ SecurityContext : & corev1.SecurityContext {
331
+ ReadOnlyRootFilesystem : ptr .To (true ),
332
+ },
327
333
},
328
334
},
329
335
Containers : []corev1.Container {
@@ -368,7 +374,7 @@ func TestPodExtractContent(t *testing.T) {
368
374
},
369
375
},
370
376
SecurityContext : & corev1.SecurityContext {
371
- ReadOnlyRootFilesystem : ptr .To (false ),
377
+ ReadOnlyRootFilesystem : ptr .To (true ),
372
378
},
373
379
ImagePullPolicy : image .InferImagePullPolicy ("image" ),
374
380
TerminationMessagePolicy : "FallbackToLogsOnError" ,
@@ -400,7 +406,7 @@ func TestPodExtractContent(t *testing.T) {
400
406
ObjectMeta : metav1.ObjectMeta {
401
407
GenerateName : "test-" ,
402
408
Namespace : "testns" ,
403
- Labels : map [string ]string {"olm.pod-spec-hash" : "b4ns9MTvaRBYOarmuFe6PLYK0r2kxj5Vo06WTU " , "olm.managed" : "true" },
409
+ Labels : map [string ]string {"olm.pod-spec-hash" : "5ToGGS7RLuy9Fq91z7IjESOJXfurg09nHAxtfK " , "olm.managed" : "true" },
404
410
Annotations : map [string ]string {"cluster-autoscaler.kubernetes.io/safe-to-evict" : "true" },
405
411
},
406
412
Spec : corev1.PodSpec {
@@ -422,6 +428,9 @@ func TestPodExtractContent(t *testing.T) {
422
428
Args : []string {"/bin/copy-content" , "/utilities/copy-content" },
423
429
VolumeMounts : []corev1.VolumeMount {{Name : "utilities" , MountPath : "/utilities" }},
424
430
TerminationMessagePolicy : "FallbackToLogsOnError" ,
431
+ SecurityContext : & corev1.SecurityContext {
432
+ ReadOnlyRootFilesystem : ptr .To (true ),
433
+ },
425
434
},
426
435
{
427
436
Name : "extract-content" ,
@@ -437,6 +446,9 @@ func TestPodExtractContent(t *testing.T) {
437
446
{Name : "catalog-content" , MountPath : "/extracted-catalog" },
438
447
},
439
448
TerminationMessagePolicy : "FallbackToLogsOnError" ,
449
+ SecurityContext : & corev1.SecurityContext {
450
+ ReadOnlyRootFilesystem : ptr .To (true ),
451
+ },
440
452
},
441
453
},
442
454
Containers : []corev1.Container {
@@ -481,7 +493,7 @@ func TestPodExtractContent(t *testing.T) {
481
493
},
482
494
},
483
495
SecurityContext : & corev1.SecurityContext {
484
- ReadOnlyRootFilesystem : ptr .To (false ),
496
+ ReadOnlyRootFilesystem : ptr .To (true ),
485
497
},
486
498
ImagePullPolicy : image .InferImagePullPolicy ("image" ),
487
499
TerminationMessagePolicy : "FallbackToLogsOnError" ,
@@ -506,7 +518,7 @@ func TestPodExtractContent(t *testing.T) {
506
518
ObjectMeta : metav1.ObjectMeta {
507
519
GenerateName : "test-" ,
508
520
Namespace : "testns" ,
509
- Labels : map [string ]string {"olm.pod-spec-hash" : "2ZOz2dIc08OnA6K8YLykbH5TuFNbwrpktFugq3 " , "olm.managed" : "true" },
521
+ Labels : map [string ]string {"olm.pod-spec-hash" : "3sDLk8MMNptrqUfdnruY2gUi1g8O4wpMWC6Q52 " , "olm.managed" : "true" },
510
522
Annotations : map [string ]string {"cluster-autoscaler.kubernetes.io/safe-to-evict" : "true" },
511
523
},
512
524
Spec : corev1.PodSpec {
@@ -553,7 +565,7 @@ func TestPodExtractContent(t *testing.T) {
553
565
SecurityContext : & corev1.SecurityContext {
554
566
Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"ALL" }},
555
567
AllowPrivilegeEscalation : ptr .To (false ),
556
- ReadOnlyRootFilesystem : ptr .To (true ),
568
+ ReadOnlyRootFilesystem : ptr .To (false ),
557
569
},
558
570
TerminationMessagePolicy : "FallbackToLogsOnError" ,
559
571
},
@@ -1021,7 +1033,7 @@ func TestPodContainerSecurityContext(t *testing.T) {
1021
1033
Capabilities : & corev1.Capabilities {
1022
1034
Drop : []corev1.Capability {"ALL" },
1023
1035
},
1024
- ReadOnlyRootFilesystem : ptr .To (true ), // Reflecting expected 'restricted' settings
1036
+ ReadOnlyRootFilesystem : ptr .To (false ), // Reflecting expected 'restricted' settings
1025
1037
},
1026
1038
expectedSecurityContext : & corev1.PodSecurityContext {
1027
1039
SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
@@ -1056,7 +1068,7 @@ func TestPodContainerSecurityContext(t *testing.T) {
1056
1068
Capabilities : & corev1.Capabilities {
1057
1069
Drop : []corev1.Capability {"ALL" },
1058
1070
},
1059
- ReadOnlyRootFilesystem : ptr .To (true ),
1071
+ ReadOnlyRootFilesystem : ptr .To (false ),
1060
1072
},
1061
1073
expectedSecurityContext : & corev1.PodSecurityContext {
1062
1074
SeccompProfile : & corev1.SeccompProfile {Type : corev1 .SeccompProfileTypeRuntimeDefault },
@@ -1111,7 +1123,7 @@ func TestPodContainerSecurityContext(t *testing.T) {
1111
1123
},
1112
1124
namespacePodSecurityConfig : v1alpha1 .Legacy , // set to the opposite of the config to catch possible errors
1113
1125
expectedContainerSecurityContext : & corev1.SecurityContext {
1114
- ReadOnlyRootFilesystem : ptr .To (true ),
1126
+ ReadOnlyRootFilesystem : ptr .To (false ),
1115
1127
AllowPrivilegeEscalation : ptr .To (false ),
1116
1128
Capabilities : & corev1.Capabilities {
1117
1129
Drop : []corev1.Capability {"ALL" },
0 commit comments