-
-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Spegel version
All since #888
Kubernetes distribution
k3s, rke2
Kubernetes version
n/a
CNI
n/a
Describe the bug
- When spegel gets a ContentCreate event from containerd, it does not advertise the layer content if the event lacks a Digest:
Lines 369 to 372 in decaf73
// Just advertise the image if it is a tag reference. if img.Digest == "" { return []OCIEvent{{Type: CreateEvent, Reference: img.Reference}}, nil }
This is a problem, as the ImageCreate events generated by containerd when an image is imported from tarball only contain the tag, not the digest. There is no event generated for the image digest, so the image digest and layer content digests are never advertised. - When containerd imports an image instead of pulling it, it does not add
containerd.io/distribution.source.<registry>=<name>labels to the content. These labels are only added by thedockerremote. This prevents the content from being properly tracked by spegel, as it applies label-based filters to image content:
Lines 561 to 578 in decaf73
func contentLabelsToReferences(l map[string]string, dgst digest.Digest) ([]Reference, error) { refs := []Reference{} for k, v := range l { if !strings.HasPrefix(k, labels.LabelDistributionSource) { continue } ref := Reference{ Registry: strings.TrimPrefix(k, labels.LabelDistributionSource+"."), Repository: v, Digest: dgst, } refs = append(refs, ref) } if len(refs) == 0 { return nil, fmt.Errorf("no distribution source labels found for %s", dgst) } return refs, nil }
Combined, these two issues make it so that spegel fails to advertise everything except the tag when content is imported instead of pulled.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working