fs/session: fix agent files incorrectly reported as directories in rootOpen
The rootOpen function in root.go had a bug where paths like 'session/<id>/agent/<aid>/state' were split into 4 parts by strings.SplitN(name, "/", 4). An if len(parts) == 4 guard incorrectly returned 'state: is a directory', turning every agent file into a directory error. Removed the erroneous guard so the code falls through to NewAgentTree(...).Open(parts[3]), which correctly opens the agent's synthetic file.
This commit is contained in:
parent
d9c2c4c7a3
commit
8d89ac31eb
|
|
@ -525,9 +525,6 @@ func rootOpen(rs *rootState, name string) (File, error) {
|
|||
if ag == nil {
|
||||
return nil, fmt.Errorf("agent %s not found in session %s", parts[2], sessID)
|
||||
}
|
||||
if len(parts) == 4 {
|
||||
return nil, fmt.Errorf("%s: is a directory", parts[3])
|
||||
}
|
||||
al := sess.AgentLogFor(ag.ID())
|
||||
if al == nil {
|
||||
return nil, fmt.Errorf("agent log not found for %s", parts[2])
|
||||
|
|
|
|||
Loading…
Reference in New Issue