Skip to content

Commit

Permalink
add: empty dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rohank07 committed Oct 5, 2022
1 parent 9fcef88 commit 98921e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish
on:
push:
branches:
- main
- downward-api
env:
REGISTRY_NAME: k8scc01covidacr

Expand Down
16 changes: 16 additions & 0 deletions notebooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,22 @@ func (s *server) NewNotebook(w http.ResponseWriter, r *http.Request) {
Value: req.Language,
})
}
// Add notebook type env var on protected-b notebooks
if _, ok := notebook.GetObjectMeta().GetLabels()["notebook.statcan.gc.ca/protected-b"]; ok {

notebook.Spec.Template.Spec.Volumes = append(notebook.Spec.Template.Spec.Volumes, corev1.Volume{
Name: "protb_nb",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{
Medium: corev1.StorageMediumMemory,
},
},
})
notebook.Spec.Template.Spec.Containers[0].VolumeMounts = append(notebook.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{
Name: "protb_nb",
MountPath: "/etc/protb",
})
}

// Add imagePullPolicy
if req.ImagePullPolicy == "Always" || req.ImagePullPolicy == "Never" || req.ImagePullPolicy == "IfNotPresent" {
Expand Down

0 comments on commit 98921e1

Please sign in to comment.