Skip to content

Commit 42c7019

Browse files
author
Zachary Seguin
committed
feat(configurations): Add configurations to the notebooks
1 parent 2f4546a commit 42c7019

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

notebooks.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ func (s *server) NewNotebook(w http.ResponseWriter, r *http.Request) {
309309
ObjectMeta: v1.ObjectMeta{
310310
Name: req.Name,
311311
Namespace: namespace,
312+
Labels: make(map[string]string),
312313
},
313314
Spec: kubeflowv1.NotebookSpec{
314315
Template: kubeflowv1.NotebookTemplateSpec{
@@ -460,6 +461,17 @@ func (s *server) NewNotebook(w http.ResponseWriter, r *http.Request) {
460461
}
461462
}
462463

464+
// Add configuration items
465+
if s.Config.SpawnerFormDefaults.Configurations.ReadOnly {
466+
for _, config := range s.Config.SpawnerFormDefaults.Configurations.Value {
467+
notebook.ObjectMeta.Labels[config] = "true"
468+
}
469+
} else {
470+
for _, config := range req.Configurations {
471+
notebook.ObjectMeta.Labels[config] = "true"
472+
}
473+
}
474+
463475
log.Printf("creating notebook %q for %q", notebook.ObjectMeta.Name, namespace)
464476

465477
// Submit the notebook to the API server

0 commit comments

Comments
 (0)