feat: add read only fs support

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
This commit is contained in:
AhmedGrati
2023-07-14 15:56:04 +01:00
parent 21509824ff
commit 4a08d41242
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -573,6 +573,11 @@ func (k *Kubernetes) UpdateKubernetesObjects(name string, service kobject.Servic
securityContext.Capabilities = capabilities
}
//set readOnlyRootFilesystem if it is enabled
if service.ReadOnly {
securityContext.ReadOnlyRootFilesystem = &service.ReadOnly
}
// update template only if securityContext is not empty
if *securityContext != (api.SecurityContext{}) {
template.Spec.Containers[0].SecurityContext = securityContext