Merge pull request #10921 from aojea/nri_network

expose Pod assigned IPs to NRI plugins
This commit is contained in:
Maksym Pavlenko
2024-11-07 02:17:53 +00:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -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
//

View File

@@ -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(),
}
}