Skip to content

Commit fec33aa

Browse files
committed
pkg/reference: deprecate SplitObject
The behavior of this function is quite counter-intuitive, as it preserves the delimiter in the result, and its use for external consumers would be very limited. Spec.Digest no longer uses this function, and it appears that BuildKit is currently the only (publicly visible) external consumer of it. This patch deprecates the function. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent ae7d74b commit fec33aa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/reference/reference.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ func (r Spec) String() string {
168168
// t, d := SplitObject("docker.io/library/ubuntu:latest@sha256:deadbeef")
169169
// fmt.Println(t) // docker.io/library/ubuntu:latest@
170170
// fmt.Println(d) // sha256:deadbeef
171+
//
172+
// Deprecated: use [Parse] and [Spec.Digest] instead.
171173
func SplitObject(obj string) (tag string, dgst digest.Digest) {
172174
if i := strings.Index(obj, "@"); i >= 0 {
173175
// Offset by one so preserve the "@" in the tag returned.

0 commit comments

Comments
 (0)