mirror of
https://github.com/containerd/containerd.git
synced 2026-08-07 00:21:24 +00:00
Merge pull request #10921 from aojea/nri_network
expose Pod assigned IPs to NRI plugins
This commit is contained in:
@@ -633,6 +633,14 @@ func (p *criPodSandbox) GetPid() uint32 {
|
||||
return p.pid
|
||||
}
|
||||
|
||||
func (p *criPodSandbox) GetIPs() []string {
|
||||
if p.IP == "" {
|
||||
return nil
|
||||
}
|
||||
ips := append([]string{p.IP}, p.AdditionalIPs...)
|
||||
return ips
|
||||
}
|
||||
|
||||
//
|
||||
// NRI integration wrapper for CRI Containers
|
||||
//
|
||||
|
||||
@@ -34,6 +34,7 @@ type PodSandbox interface {
|
||||
GetLinuxPodSandbox() LinuxPodSandbox
|
||||
|
||||
GetPid() uint32
|
||||
GetIPs() []string
|
||||
}
|
||||
|
||||
type LinuxPodSandbox interface {
|
||||
@@ -55,6 +56,7 @@ func commonPodSandboxToNRI(pod PodSandbox) *nri.PodSandbox {
|
||||
Annotations: pod.GetAnnotations(),
|
||||
RuntimeHandler: pod.GetRuntimeHandler(),
|
||||
Pid: pod.GetPid(),
|
||||
Ips: pod.GetIPs(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user