Merge pull request #7535 from samuelkarp/ip-leakage-flake

cri: PodSandboxStatus should tolerate missing task
This commit is contained in:
Maksym Pavlenko
2022-10-15 16:51:46 -07:00
committed by GitHub
2 changed files with 14 additions and 10 deletions

View File

@@ -155,12 +155,14 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st
var processStatus containerd.ProcessStatus var processStatus containerd.ProcessStatus
if task != nil { if task != nil {
taskStatus, err := task.Status(ctx) if taskStatus, err := task.Status(ctx); err != nil {
if err != nil { if !errdefs.IsNotFound(err) {
return nil, fmt.Errorf("failed to get task status: %w", err) return nil, fmt.Errorf("failed to get task status: %w", err)
}
processStatus = containerd.Unknown
} else {
processStatus = taskStatus.Status
} }
processStatus = taskStatus.Status
} }
si := &SandboxInfo{ si := &SandboxInfo{

View File

@@ -155,12 +155,14 @@ func toCRISandboxInfo(ctx context.Context, sandbox sandboxstore.Sandbox) (map[st
var processStatus containerd.ProcessStatus var processStatus containerd.ProcessStatus
if task != nil { if task != nil {
taskStatus, err := task.Status(ctx) if taskStatus, err := task.Status(ctx); err != nil {
if err != nil { if !errdefs.IsNotFound(err) {
return nil, fmt.Errorf("failed to get task status: %w", err) return nil, fmt.Errorf("failed to get task status: %w", err)
}
processStatus = containerd.Unknown
} else {
processStatus = taskStatus.Status
} }
processStatus = taskStatus.Status
} }
si := &SandboxInfo{ si := &SandboxInfo{