Skip to content

Commit

Permalink
feat(configurations): Add configurations to the notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Seguin committed Aug 12, 2020
1 parent 2f4546a commit 42c7019
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions notebooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func (s *server) NewNotebook(w http.ResponseWriter, r *http.Request) {
ObjectMeta: v1.ObjectMeta{
Name: req.Name,
Namespace: namespace,
Labels: make(map[string]string),
},
Spec: kubeflowv1.NotebookSpec{
Template: kubeflowv1.NotebookTemplateSpec{
Expand Down Expand Up @@ -460,6 +461,17 @@ func (s *server) NewNotebook(w http.ResponseWriter, r *http.Request) {
}
}

// Add configuration items
if s.Config.SpawnerFormDefaults.Configurations.ReadOnly {
for _, config := range s.Config.SpawnerFormDefaults.Configurations.Value {
notebook.ObjectMeta.Labels[config] = "true"
}
} else {
for _, config := range req.Configurations {
notebook.ObjectMeta.Labels[config] = "true"
}
}

log.Printf("creating notebook %q for %q", notebook.ObjectMeta.Name, namespace)

// Submit the notebook to the API server
Expand Down

0 comments on commit 42c7019

Please sign in to comment.