Skip to content

Commit

Permalink
vendor: docker v27 (#351)
Browse files Browse the repository at this point in the history
fixes some otel vendoring madness

fixes #350

Signed-off-by: Nick Santos <[email protected]>
  • Loading branch information
nicks authored Aug 7, 2024
1 parent 38d3999 commit 2efe977
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ toolchain go1.22.4

require (
github.com/blang/semver/v4 v4.0.0
github.com/docker/cli v26.1.4+incompatible
github.com/docker/cli v27.1.1+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v26.1.4+incompatible
github.com/docker/docker v27.1.1+incompatible
github.com/docker/go-connections v0.4.0
github.com/google/go-cmp v0.6.0
github.com/mitchellh/go-homedir v1.1.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v26.1.4+incompatible h1:I8PHdc0MtxEADqYJZvhBrW9bo8gawKwwenxRM7/rLu8=
github.com/docker/cli v26.1.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE=
github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v26.1.4+incompatible h1:vuTpXDuoga+Z38m1OZHzl7NKisKWaWlhjQk7IDPSLsU=
github.com/docker/docker v26.1.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY=
github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
Expand Down
24 changes: 21 additions & 3 deletions pkg/cluster/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,30 @@ package cluster
import (
"context"
"os"

"github.com/docker/docker/pkg/stringid"
"regexp"

"github.com/tilt-dev/ctlptl/internal/dctr"
)

const (
shortLen = 12
)

var (
validShortID = regexp.MustCompile("^[a-f0-9]{12}$")
)

// IsShortID determines if id has the correct format and length for a short ID.
// It checks the IDs length and if it consists of valid characters for IDs (a-f0-9).
//
// Deprecated: this function is no longer used, and will be removed in the next release.
func isShortID(id string) bool {
if len(id) != shortLen {
return false
}
return validShortID.MatchString(id)
}

type detectInContainer interface {
insideContainer(ctx context.Context) string
}
Expand Down Expand Up @@ -37,7 +55,7 @@ func insideContainer(ctx context.Context, client dctr.Client) string {
return ""
}

if !stringid.IsShortID(containerID) {
if !isShortID(containerID) {
return ""
}

Expand Down

0 comments on commit 2efe977

Please sign in to comment.