@@ -317,6 +317,17 @@ func createDefiniteWorkspacePod(sctx *startWorkspaceContext) (*corev1.Pod, error
317317 },
318318 }
319319
320+ if sctx .Config .EnableCustomSSLCertificate {
321+ volumes = append (volumes , corev1.Volume {
322+ Name : "gitpod-ca-crt" ,
323+ VolumeSource : corev1.VolumeSource {
324+ ConfigMap : & corev1.ConfigMapVolumeSource {
325+ LocalObjectReference : corev1.LocalObjectReference {Name : "gitpod-customer-certificate-bundle" },
326+ },
327+ },
328+ })
329+ }
330+
320331 workloadType := "regular"
321332 if sctx .Headless {
322333 workloadType = "headless"
@@ -463,6 +474,29 @@ func createWorkspaceContainer(sctx *startWorkspaceContext) (*corev1.Container, e
463474
464475 image := fmt .Sprintf ("%s/%s/%s" , sctx .Config .RegistryFacadeHost , regapi .ProviderPrefixRemote , sctx .Workspace .Name )
465476
477+ volumeMounts := []corev1.VolumeMount {
478+ {
479+ Name : workspaceVolumeName ,
480+ MountPath : workspaceDir ,
481+ ReadOnly : false ,
482+ MountPropagation : & mountPropagation ,
483+ },
484+ {
485+ MountPath : "/.workspace" ,
486+ Name : "daemon-mount" ,
487+ MountPropagation : & mountPropagation ,
488+ },
489+ }
490+
491+ if sctx .Config .EnableCustomSSLCertificate {
492+ volumeMounts = append (volumeMounts , corev1.VolumeMount {
493+ Name : "gitpod-ca-crt" ,
494+ MountPath : "/etc/ssl/certs/gitpod-ca.crt" ,
495+ SubPath : "ca-certificates.crt" ,
496+ ReadOnly : true ,
497+ })
498+ }
499+
466500 return & corev1.Container {
467501 Name : "workspace" ,
468502 Image : image ,
@@ -475,19 +509,7 @@ func createWorkspaceContainer(sctx *startWorkspaceContext) (*corev1.Container, e
475509 Limits : limits ,
476510 Requests : requests ,
477511 },
478- VolumeMounts : []corev1.VolumeMount {
479- {
480- Name : workspaceVolumeName ,
481- MountPath : workspaceDir ,
482- ReadOnly : false ,
483- MountPropagation : & mountPropagation ,
484- },
485- {
486- MountPath : "/.workspace" ,
487- Name : "daemon-mount" ,
488- MountPropagation : & mountPropagation ,
489- },
490- },
512+ VolumeMounts : volumeMounts ,
491513 ReadinessProbe : readinessProbe ,
492514 Env : env ,
493515 Command : command ,
@@ -547,10 +569,21 @@ func createWorkspaceEnvironment(sctx *startWorkspaceContext) ([]corev1.EnvVar, e
547569 result = append (result , corev1.EnvVar {Name : "THEIA_WEBVIEW_EXTERNAL_ENDPOINT" , Value : "webview-{{hostname}}" })
548570 result = append (result , corev1.EnvVar {Name : "THEIA_MINI_BROWSER_HOST_PATTERN" , Value : "browser-{{hostname}}" })
549571
550- // We don't require that Git be configured for workspaces
551- if sctx .Workspace .Spec .Git != nil {
552- result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_NAME" , Value : sctx .Workspace .Spec .Git .Username })
553- result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_EMAIL" , Value : sctx .Workspace .Spec .Git .Email })
572+ if sctx .Config .EnableCustomSSLCertificate {
573+ const (
574+ customCAMountPath = "/etc/ssl/certs/gitpod-ca.crt"
575+ certsMountPath = "/etc/ssl/certs/"
576+ )
577+
578+ result = append (result , corev1.EnvVar {Name : "NODE_EXTRA_CA_CERTS" , Value : customCAMountPath })
579+ result = append (result , corev1.EnvVar {Name : "GIT_SSL_CAPATH" , Value : certsMountPath })
580+ result = append (result , corev1.EnvVar {Name : "GIT_SSL_CAINFO" , Value : customCAMountPath })
581+
582+ // We don't require that Git be configured for workspaces
583+ if sctx .Workspace .Spec .Git != nil {
584+ result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_NAME" , Value : sctx .Workspace .Spec .Git .Username })
585+ result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_EMAIL" , Value : sctx .Workspace .Spec .Git .Email })
586+ }
554587 }
555588
556589 // System level env vars
0 commit comments