@@ -557,7 +557,12 @@ func (cmd *UpCmd) startSync() []*synctool.SyncConfig {
557557 labels = append (labels , key + "=" + * value )
558558 }
559559
560- pod , err := kubectl .GetFirstRunningPod (cmd .kubectl , strings .Join (labels , ", " ), * config .DevSpace .Release .Namespace )
560+ namespace := * config .DevSpace .Release .Namespace
561+ if syncPath .Namespace != nil && * syncPath .Namespace != "" {
562+ namespace = * syncPath .Namespace
563+ }
564+
565+ pod , err := kubectl .GetFirstRunningPod (cmd .kubectl , strings .Join (labels , ", " ), namespace )
561566
562567 if err != nil {
563568 log .Panicf ("Unable to list devspace pods: %s" , err .Error ())
@@ -608,7 +613,12 @@ func (cmd *UpCmd) startPortForwarding() {
608613 labels = append (labels , key + "=" + * value )
609614 }
610615
611- pod , err := kubectl .GetFirstRunningPod (cmd .kubectl , strings .Join (labels , ", " ), * config .DevSpace .Release .Namespace )
616+ namespace := * config .DevSpace .Release .Namespace
617+ if portForwarding .Namespace != nil && * portForwarding .Namespace != "" {
618+ namespace = * portForwarding .Namespace
619+ }
620+
621+ pod , err := kubectl .GetFirstRunningPod (cmd .kubectl , strings .Join (labels , ", " ), namespace )
612622
613623 if err != nil {
614624 log .Errorf ("Unable to list devspace pods: %s" , err .Error ())
0 commit comments