Add check for CNI plugins before tearing down pod network
Signed-off-by: Sameer <sameer.saeed@live.ca>
This commit is contained in:
		| @@ -111,8 +111,10 @@ func (c *criService) stopPodSandbox(ctx context.Context, sandbox sandboxstore.Sa | |||||||
| 		} else if closed { | 		} else if closed { | ||||||
| 			sandbox.NetNSPath = "" | 			sandbox.NetNSPath = "" | ||||||
| 		} | 		} | ||||||
| 		if err := c.teardownPodNetwork(ctx, sandbox); err != nil { | 		if sandbox.CNIResult != nil { | ||||||
| 			return fmt.Errorf("failed to destroy network for sandbox %q: %w", id, err) | 			if err := c.teardownPodNetwork(ctx, sandbox); err != nil { | ||||||
|  | 				return fmt.Errorf("failed to destroy network for sandbox %q: %w", id, err) | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 		if err := sandbox.NetNS.Remove(); err != nil { | 		if err := sandbox.NetNS.Remove(); err != nil { | ||||||
| 			return fmt.Errorf("failed to remove network namespace for sandbox %q: %w", id, err) | 			return fmt.Errorf("failed to remove network namespace for sandbox %q: %w", id, err) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sameer
					Sameer