From 0a472213d37e92368c75f13093c54f9be9d6b7c7 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Thu, 25 Jan 2024 09:59:57 -0600 Subject: [PATCH] splat trial --- .../compute/server/servers/server_default.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/daemons/compute/server/servers/server_default.go b/daemons/compute/server/servers/server_default.go index a842c70d..92a5ff77 100644 --- a/daemons/compute/server/servers/server_default.go +++ b/daemons/compute/server/servers/server_default.go @@ -803,14 +803,25 @@ func (s *defaultServer) findRabbitRelativeSource(ctx context.Context, computeMou for _, clientMount := range clientMounts.Items { for _, mount := range clientMount.Spec.Mounts { if *computeMountInfo.Device.DeviceReference == *mount.Device.DeviceReference { + var path string + log.Println("BLAKE ---------------------------------------") log.Println("mount.MountPath: " + mount.MountPath) log.Println("req.Source: " + req.Source) log.Println("computeMountInfo.MountPath: " + computeMountInfo.MountPath) - ret := mount.MountPath + strings.TrimPrefix(req.Source, computeMountInfo.MountPath) - log.Println("ret: " + ret) + + // If these match, then the user is asking for the entire NNF directory. In that + // case, dcp will copy over the index mount directory (e.g. /mnt/nnf/.../0/) for + // that compute node. We do not want to copy over the index mount directories. + if req.Source == computeMountInfo.MountPath { + path = filepath.Join(mount.MountPath, "*") + } else { + path = filepath.Join(mount.MountPath, strings.TrimPrefix(req.Source, computeMountInfo.MountPath)) + } + + log.Println("path: " + path) log.Println("---------------------------------------------") - return ret, nil + return path, nil } } }