diff --git a/modules/mesh-delivery-builder/internal/build/run_test.go b/modules/mesh-delivery-builder/internal/build/run_test.go index 2e927ef1..83c965e7 100644 --- a/modules/mesh-delivery-builder/internal/build/run_test.go +++ b/modules/mesh-delivery-builder/internal/build/run_test.go @@ -1403,8 +1403,7 @@ func aDoneKeyKeepsEachFormACountedNodeReads(t *testing.T) { t.Errorf("%s %s: the want of %s is held", k.kind, row.name, node) } } - // mesh-sdk's referenceProblem does not yet know the holder's upstream// naming (a request to the SDK's owner). - if _, err := delivery.EncodeBuilderBuild(delivery.BuilderBuild{State: delivery.BuildDone, Manifest: strings.TrimPrefix(digest, "sha256:"), Artifacts: []delivery.BuiltArtifact{a}, Needs: needs}); err != nil && k.kind != "upstream" { + if _, err := delivery.EncodeBuilderBuild(delivery.BuilderBuild{State: delivery.BuildDone, Manifest: strings.TrimPrefix(digest, "sha256:"), Artifacts: []delivery.BuiltArtifact{a}, Needs: needs}); err != nil { t.Errorf("%s %s: %v", k.kind, row.name, err) } } diff --git a/sdk/forms/forms.go b/sdk/forms/forms.go index 4183ef84..8f447800 100644 --- a/sdk/forms/forms.go +++ b/sdk/forms/forms.go @@ -36,27 +36,11 @@ const ( // //@sha256: (novox/hq ADR 0605 §9; catalogue.SeatReference, read back by // catalogue.InRegistrySeat): a bundle or an archive through oci-artifact-registry, an image through // container-image-registry, and an upstream copy through container-image-registry under the holder's own naming, -// container-image-registry/upstream//@sha256:. It is read by a node-engine that states +// container-image-registry/upstream//@sha256: (catalogue.InUpstream). It is read by a node-engine that states // form:seat-reference (catalogue.ReferenceFormSeat). Not a first form: an engine stating nothing reads the artifact in the // older artifact-store form, which it derives (Older). const FormSeatReference = catalogue.ReferenceFormSeat -// upstreamPrefix opens an upstream copy's name in the image seat's answer: the holder's naming, upstream//. -const upstreamPrefix = "upstream/" - -// inSeatReference reads a reference in the seat form: the seat it came through and the name and digest after it, -// /@ (or upstream//@ for an upstream copy of the image seat). -func inSeatReference(r string) (seat, path string, ok bool) { - if seat, path, ok = catalogue.InRegistrySeat(r); ok { - return seat, path, true - } - rest, found := strings.CutPrefix(r, catalogue.ContainerImageRegistrySeat+"/"+upstreamPrefix) - if !found || !strings.Contains(rest, "@sha256:") { - return "", "", false - } - return catalogue.ContainerImageRegistrySeat, upstreamPrefix + rest, true -} - // ArtifactForm is one reference form: its name, whether it is a first form, the artifact kinds it names, how a // reference is told to be in it, and, for a form that names the same artifact an older form does, that older reference // (Older, nil when it derives none): the old-form window writes it beside the answered one (ADR 0624 §1, §3). @@ -84,19 +68,13 @@ var Current = ArtifactForms{ {Name: FormPackageVersion, First: true, Is: func(r string) bool { return strings.LastIndex(r, "@") > 0 && !strings.Contains(r, "@sha256:") }, Kinds: []string{catalogue.ArtifactPackage}}, {Name: FormSeatReference, Kinds: []string{catalogue.ArtifactBundle, catalogue.ArtifactArchive, catalogue.ArtifactImage, catalogue.ArtifactUpstream}, - Is: func(r string) bool { - seat, _, ok := inSeatReference(r) - return ok && (seat == catalogue.OciArtifactRegistrySeat || seat == catalogue.ContainerImageRegistrySeat) - }, - // The same artifact in the artifact store's form: oci-artifact-registry//@ is artifact-store:////blobs/; - // container-image-registry//@ (an upstream copy's upstream//

@ likewise) is artifact-store:///@. + Is: func(r string) bool { _, _, ok := catalogue.InRegistrySeat(r); return ok }, + // The same artifact in the artifact store's form (catalogue.InArtifactStore): oci-artifact-registry//@ is + // artifact-store:////blobs/; container-image-registry//@ is artifact-store:///@, and an + // upstream copy's container-image-registry/upstream//

@ is artifact-store://upstream//

@. Older: func(r string) string { - seat, rest, _ := inSeatReference(r) - if seat == catalogue.OciArtifactRegistrySeat { - path, _ := catalogue.InArtifactStore(r) - return catalogue.ArtifactStoreScheme + path - } - return catalogue.ArtifactStoreScheme + rest + path, _ := catalogue.InArtifactStore(r) + return catalogue.ArtifactStoreScheme + path }}, }