Skip to content

Commit 1382455

Browse files
committed
Fix restore init-container security context
Signed-off-by: Tamal Saha <[email protected]>
1 parent fcf0087 commit 1382455

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/util/kubernetes.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ func UpsertSecurityContext(currentSC, newSC *core.SecurityContext) *core.Securit
124124
if newSC.SELinuxOptions != nil {
125125
finalSC.SELinuxOptions = newSC.SELinuxOptions
126126
}
127+
if newSC.WindowsOptions != nil {
128+
finalSC.WindowsOptions = newSC.WindowsOptions
129+
}
127130
if newSC.RunAsUser != nil {
128131
finalSC.RunAsUser = newSC.RunAsUser
129132
}
@@ -142,7 +145,12 @@ func UpsertSecurityContext(currentSC, newSC *core.SecurityContext) *core.Securit
142145
if newSC.ProcMount != nil {
143146
finalSC.ProcMount = newSC.ProcMount
144147
}
145-
148+
if newSC.SeccompProfile != nil {
149+
finalSC.SeccompProfile = newSC.SeccompProfile
150+
}
151+
if newSC.AppArmorProfile != nil {
152+
finalSC.AppArmorProfile = newSC.AppArmorProfile
153+
}
146154
return finalSC
147155
}
148156

0 commit comments

Comments
 (0)