Skip to content
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

[v1.11] Adjust image references for introspection with containerd #1620

Merged
merged 1 commit into from
Dec 6, 2023
Merged
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
10 changes: 8 additions & 2 deletions pkg/cmd/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -273,11 +274,16 @@ func (o *OperatorOptions) Complete(ctx context.Context, cmd *cobra.Command) erro
return fmt.Errorf("can't wait for pod %q to have container status for container %q: %w", naming.ObjRef(pod), soContainerName, err)
}

if len(cs.ImageID) == 0 {
imageID := cs.ImageID

// containerd can't pull its own reference, so we need to strip the prefix.
imageID = strings.TrimPrefix(imageID, "docker-pullable://")

if len(imageID) == 0 {
return fmt.Errorf("can't introspect its own image: containerStatus.imageID for container %q in pod %q is empty", soContainerName, naming.ObjRef(pod))
}

o.OperatorImage = cs.ImageID
o.OperatorImage = imageID

klog.V(2).InfoS("Successfully introspected its own image", "OperatorImage", o.OperatorImage)
}
Expand Down