diff --git a/internal/agent/agent_test.go b/internal/agent/agent_test.go index 548ddff4..c6b39f38 100644 --- a/internal/agent/agent_test.go +++ b/internal/agent/agent_test.go @@ -372,6 +372,11 @@ func TestAWantAndItsCompositionApplyTheModuleAndTheHaveNamesBoth(t *testing.T) { if got := partsDifference(map[string]string{"web:c": d3}, []json.RawMessage{container, upstream}); got != "" { t.Fatalf("an upstream image pinned by its digest is a part: %q", got) } + // And neither is the registry seat's copy of an upstream image, though it is routed through the seat. + mirrored := json.RawMessage(`{"id":"web.m","type":"container","name":"web-m","image":"store:5000/upstream/docker.io/library/registry@` + d1 + `","image-seat":"container-image-registry","image-holder":"n1","module":"web"}`) + if got := partsDifference(map[string]string{"web:c": d3}, []json.RawMessage{container, mirrored}); got != "" { + t.Fatalf("an upstream copy served through the registry seat is a part: %q", got) + } if got := partsDifference(map[string]string{"web:c": d3}, []json.RawMessage{upstream}); !strings.Contains(got, "in the want's parts and not fetched: "+d3) || strings.Contains(got, d2) { t.Fatalf("with only an upstream image the mesh-built one is not missing, or the upstream one is named: %q", got) } diff --git a/internal/agent/parts.go b/internal/agent/parts.go index f5f0482c..526903fc 100644 --- a/internal/agent/parts.go +++ b/internal/agent/parts.go @@ -6,6 +6,7 @@ import ( "sort" "strings" + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/containerimageregistryclient/reference" "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/declaration" ) @@ -43,6 +44,17 @@ func heldForEntry(why string) bool { return strings.HasPrefix(why, EntryAsked) || strings.HasPrefix(why, EntryMissing) } +// upstreamCopy is whether a routed image is the registry seat's copy of an upstream image, `
/upstream/