diff --git a/pkg/cmd/operator/operator.go b/pkg/cmd/operator/operator.go index d4d67839619..93ffdaa06bf 100644 --- a/pkg/cmd/operator/operator.go +++ b/pkg/cmd/operator/operator.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "strings" "sync" "time" @@ -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) }