Merge pull request #7535 from samuelkarp/ip-leakage-flake
cri: PodSandboxStatus should tolerate missing task
This commit is contained in:
		| @@ -155,13 +155,15 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st | ||||
|  | ||||
| 	var processStatus containerd.ProcessStatus | ||||
| 	if task != nil { | ||||
| 		taskStatus, err := task.Status(ctx) | ||||
| 		if err != nil { | ||||
| 		if taskStatus, err := task.Status(ctx); err != nil { | ||||
| 			if !errdefs.IsNotFound(err) { | ||||
| 				return nil, fmt.Errorf("failed to get task status: %w", err) | ||||
| 			} | ||||
|  | ||||
| 			processStatus = containerd.Unknown | ||||
| 		} else { | ||||
| 			processStatus = taskStatus.Status | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	si := &SandboxInfo{ | ||||
| 		Pid:            sandbox.Status.Get().Pid, | ||||
|   | ||||
| @@ -155,13 +155,15 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st | ||||
|  | ||||
| 	var processStatus containerd.ProcessStatus | ||||
| 	if task != nil { | ||||
| 		taskStatus, err := task.Status(ctx) | ||||
| 		if err != nil { | ||||
| 		if taskStatus, err := task.Status(ctx); err != nil { | ||||
| 			if !errdefs.IsNotFound(err) { | ||||
| 				return nil, fmt.Errorf("failed to get task status: %w", err) | ||||
| 			} | ||||
|  | ||||
| 			processStatus = containerd.Unknown | ||||
| 		} else { | ||||
| 			processStatus = taskStatus.Status | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	si := &SandboxInfo{ | ||||
| 		Pid:            sandbox.Status.Get().Pid, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Maksym Pavlenko
					Maksym Pavlenko