Skip to content

Commit

Permalink
fix(): Handle NSC pods with no parent containers
Browse files Browse the repository at this point in the history
fix(): Handle NSC pods with no parent containers
  • Loading branch information
narmidm authored Jan 9, 2024
2 parents 87c58e5 + cf83f5e commit fc74a94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/networkservice/mechanisms/recvfd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package recvfd
import (
"context"
"net/url"
"os"
"sync"

"github.com/kubeslice/cmd-forwarder-kernel/internal/tools/fs"
Expand Down Expand Up @@ -53,8 +54,16 @@ func recvFDAndSwapInodeToFile(ctx context.Context, fileMap *perConnectionFileMap
return nil
}

fileNotPresentOnSystem := false
file, ok := fileMap.filesByInodeURL[inodeURLStr]
if !ok {
if ok {
// Check if the file is present
_, err := os.Stat(file)
if err != nil {
fileNotPresentOnSystem = true
}
}
if !ok || fileNotPresentOnSystem {
var err error
file, err = fs.GetNetnsFilePath(inodeURLStr)
if err != nil {
Expand Down

0 comments on commit fc74a94

Please sign in to comment.