Skip to content

OCPBUGS-55394: Address Metal Failures with PIS #5014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions pkg/daemon/pinned_image_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ const (
)

var (
errInsufficientStorage = errors.New("storage available is less than minimum required")
errFailedToPullImage = errors.New("failed to pull image")
errNotFound = errors.New("not found")
errRequeueAfterTimeout = errors.New("requeue: prefetching images incomplete after timeout")
errInsufficientStorage = errors.New("storage available is less than minimum required")
errFailedToPullImage = errors.New("failed to pull image")
errFailedToManifestInspect = errors.New("failed to execute podman manifest inspect")
errNotFound = errors.New("not found")
errRequeueAfterTimeout = errors.New("requeue: prefetching images incomplete after timeout")
)

// PinnedImageSetManager manages the prefetching of images.
Expand Down Expand Up @@ -1139,12 +1140,27 @@ func (p *PinnedImageSetManager) getImageSize(ctx context.Context, imageName, aut
imageName,
}

output, err := exec.CommandContext(ctx, "podman", args...).CombinedOutput()
if err != nil && strings.Contains(err.Error(), "manifest unknown") {
return 0, errNotFound
}
var lastErr error
tries := 0
var output []byte
err := wait.PollUntilContextCancel(ctx, 2*time.Second, true, func(ctx context.Context) (bool, error) {
tries++

output, err := exec.CommandContext(ctx, "podman", args...).CombinedOutput()
lastErr = err
if err != nil && strings.Contains(err.Error(), "manifest unknown") {
return true, errNotFound
}
if err != nil {
klog.Infof("%v %q: Output:%s Error:%v", errFailedToManifestInspect, imageName, output, err)
return false, nil
}

return true, nil
})
// this is only an error if ctx has error or limits are exceeded
if err != nil {
return 0, fmt.Errorf("failed to execute podman manifest inspect for %q: Output:%s Error:%w", imageName, output, err)
return 0, fmt.Errorf("%w %q (%d tries): %w: %w", errFailedToManifestInspect, imageName, tries, err, lastErr)
}

var manifest ocispec.Manifest
Expand Down