@@ -441,6 +441,49 @@ spec:
441441 _ , _ = utils .Run (cmd )
442442 })
443443
444+ It ("should add volumes from podOverrides" , func () {
445+ notebookName := "e2e-pod-overrides"
446+
447+ By ("creating a MarimoNotebook with podOverrides volumes" )
448+ notebookYAML := fmt .Sprintf (`
449+ apiVersion: marimo.io/v1alpha1
450+ kind: MarimoNotebook
451+ metadata:
452+ name: %s
453+ namespace: %s
454+ spec:
455+ source: "https://github.com/marimo-team/marimo.git"
456+ podOverrides:
457+ volumes:
458+ - name: ssh-pubkey
459+ secret:
460+ secretName: ssh-pubkey
461+ defaultMode: 0600
462+ ` , notebookName , testNamespace )
463+
464+ yamlFile := filepath .Join ("/tmp" , notebookName + ".yaml" )
465+ err := os .WriteFile (yamlFile , []byte (notebookYAML ), 0644 )
466+ Expect (err ).NotTo (HaveOccurred ())
467+
468+ cmd := exec .Command ("kubectl" , "apply" , "-f" , yamlFile )
469+ _ , err = utils .Run (cmd )
470+ Expect (err ).NotTo (HaveOccurred (), "Failed to create MarimoNotebook" )
471+
472+ By ("verifying Pod has the overridden volume" )
473+ verifyVolumePresent := func (g Gomega ) {
474+ cmd := exec .Command ("kubectl" , "get" , "pod" , notebookName , "-n" , testNamespace ,
475+ "-o" , `jsonpath={.spec.volumes[?(@.name=="ssh-pubkey")].secret.secretName}` )
476+ output , err := utils .Run (cmd )
477+ g .Expect (err ).NotTo (HaveOccurred ())
478+ g .Expect (output ).To (Equal ("ssh-pubkey" ))
479+ }
480+ Eventually (verifyVolumePresent , 2 * time .Minute , time .Second ).Should (Succeed ())
481+
482+ By ("cleaning up" )
483+ cmd = exec .Command ("kubectl" , "delete" , "marimo" , notebookName , "-n" , testNamespace )
484+ _ , _ = utils .Run (cmd )
485+ })
486+
444487 It ("should create sidecar containers with exposed ports" , func () {
445488 notebookName := "e2e-sidecar"
446489
0 commit comments