Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pvc] add init container to workspace to chown pvc mount folder #14096

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/ws-manager/pkg/manager/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,21 @@ func (m *Manager) createDefiniteWorkspacePod(startContext *startWorkspaceContext
gitpodGUID := int64(133332)
pod.Spec.SecurityContext.FSGroup = &gitpodGUID

// add init container to chown workspace subpath, so that it is owned by gitpod user (there is no k8s native way of doing this as of right now)
pod.Spec.InitContainers = append(pod.Spec.InitContainers, corev1.Container{
utam0k marked this conversation as resolved.
Show resolved Hide resolved
Name: "chown-workspace",
Image: "busybox",
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"chown", "133332:133332", "/workspace"},
VolumeMounts: []corev1.VolumeMount{
{
Name: workspaceVolumeName,
SubPath: "workspace",
MountPath: "/workspace",
},
},
})

case api.WorkspaceFeatureFlag_WORKSPACE_CLASS_LIMITING:
limits := startContext.Class.Container.Limits
if limits != nil && limits.CPU != nil {
Expand Down