14965: Fixes rmdir and rename op encoding
[arvados.git] / lib / controller / fed_containers.go
index 7b8cdabe5524898e215120941e9400bcae5d510c..7fd5b25ad22b8b946f7a36e57859cce1896d80e7 100644 (file)
@@ -99,8 +99,14 @@ func remoteContainerRequestCreate(
                        containerRequest["runtime_token"] = newtok.TokenV2()
                } else {
                        // Remote user. Container request will use the
-                       // current token.
-                       containerRequest["runtime_token"] = creds.Tokens[0]
+                       // current token, minus the trailing portion
+                       // (optional container uuid).
+                       sp := strings.Split(creds.Tokens[0], "/")
+                       if len(sp) >= 3 {
+                               containerRequest["runtime_token"] = strings.Join(sp[0:3], "/")
+                       } else {
+                               containerRequest["runtime_token"] = creds.Tokens[0]
+                       }
                }
        }