Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions containers/container.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package containers

import (
"errors"
"io"
"log"
"net/http"
Expand Down Expand Up @@ -169,11 +170,11 @@ func NewContainer(id ContainerID, cg *cgroup.Cgroup, md *ContainerMetadata, pid
return nil, err
}
defer netNs.Close()
// /k8s/%s/%s/%s split
// /k8s/ -> namespace
// %s -> pod name

split := strings.Split(string(id), "/")
if len(split) < 4 {
klog.Errorf("unexpected container id %s", id)
Comment thread
mayankpande88 marked this conversation as resolved.
return nil, errors.New("unexpected container id")
}
namespace := split[2]
podName := split[3]
src_workload := registry.ip_resolver.ResolvePodOwner(podName, namespace)
Expand Down