Skip to content

Commit c16bf6e

Browse files
Paul Weildeads2k
Paul Weil
authored andcommitted
UPSTREAM: 22857: partial - ensure DetermineEffectiveSC retains the container setting for readonlyrootfs
:100644 100644 9bd5b16... de6a16d... M pkg/securitycontext/provider.go
1 parent 17e8389 commit c16bf6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: pkg/securitycontext/provider.go

+5
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ func DetermineEffectiveSecurityContext(pod *api.Pod, container *api.Container) *
159159
*effectiveSc.RunAsNonRoot = *containerSc.RunAsNonRoot
160160
}
161161

162+
if containerSc.ReadOnlyRootFilesystem != nil {
163+
effectiveSc.ReadOnlyRootFilesystem = new(bool)
164+
*effectiveSc.ReadOnlyRootFilesystem = *containerSc.ReadOnlyRootFilesystem
165+
}
166+
162167
return effectiveSc
163168
}
164169

0 commit comments

Comments
 (0)