| 458 | } |
| 459 | |
| 460 | func (pm *PluginManager) GetPodNetworkStatus( |
| 461 | podNamespace, podName string, |
| 462 | id config.ContainerID, |
| 463 | ) (*PodNetworkStatus, error) { |
| 464 | const operation = "get_pod_network_status" |
| 465 | defer recordOperation(operation, time.Now()) |
| 466 | fullPodName := buildPodFullName(podName, podNamespace) |
| 467 | pm.podLock(fullPodName).Lock() |
| 468 | defer pm.podUnlock(fullPodName) |
| 469 | |
| 470 | netStatus, err := pm.plugin.GetPodNetworkStatus(podNamespace, podName, id) |
| 471 | if err != nil { |
| 472 | recordError(operation) |
| 473 | return nil, fmt.Errorf( |
| 474 | "networkPlugin %s failed on the status hook for pod %q: %v", |
| 475 | pm.plugin.Name(), |
| 476 | fullPodName, |
| 477 | err, |
| 478 | ) |
| 479 | } |
| 480 | |
| 481 | return netStatus, nil |
| 482 | } |
| 483 | |
| 484 | func (pm *PluginManager) SetUpPod( |
| 485 | podNamespace, podName string, |