Skip to content

Commit

Permalink
feat: configure securityContext for che-gateway container (#1358)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Dec 18, 2024
1 parent c47e453 commit 0db6aba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/provision/workspace/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ func SyncRoutingToCluster(
return nil, nil, statusMsg, &dwerrors.RetryError{Message: statusMsg, RequeueAfter: 5 * time.Second}
}

// Configure securityContext for pod additions, for example che-gateway container
// https://github.com/eclipse-che/che/issues/22747
if clusterRouting.Status.PodAdditions != nil &&
workspace.Config.Workspace != nil &&
workspace.Config.Workspace.ContainerSecurityContext != nil {

for i, container := range clusterRouting.Status.PodAdditions.Containers {
if container.SecurityContext == nil {
clusterRouting.Status.PodAdditions.Containers[i].SecurityContext = workspace.Config.Workspace.ContainerSecurityContext
}
}
}

return clusterRouting.Status.PodAdditions, clusterRouting.Status.ExposedEndpoints, statusMsg, nil
}

Expand Down

0 comments on commit 0db6aba

Please sign in to comment.