diff --git a/go.mod b/go.mod index 432d4316..21f9fd8b 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/distribution/reference v0.6.0 github.com/docker/cli v27.4.1+incompatible - github.com/docker/cli-docs-tool v0.8.0 + github.com/docker/cli-docs-tool v0.9.0 github.com/docker/docker v27.4.1+incompatible github.com/docker/go-units v0.5.0 github.com/gofrs/flock v0.12.1 @@ -87,7 +87,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/containerd/api v1.7.19 // indirect github.com/containerd/ttrpc v1.2.5 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect diff --git a/go.sum b/go.sum index 844df472..c2c8d114 100644 --- a/go.sum +++ b/go.sum @@ -114,8 +114,8 @@ github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQ github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= -github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -127,8 +127,8 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v27.4.1+incompatible h1:VzPiUlRJ/xh+otB75gva3r05isHMo5wXDfPRi5/b4hI= github.com/docker/cli v27.4.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli-docs-tool v0.8.0 h1:YcDWl7rQJC3lJ7WVZRwSs3bc9nka97QLWfyJQli8yJU= -github.com/docker/cli-docs-tool v0.8.0/go.mod h1:8TQQ3E7mOXoYUs811LiPdUnAhXrcVsBIrW21a5pUbdk= +github.com/docker/cli-docs-tool v0.9.0 h1:CVwQbE+ZziwlPqrJ7LRyUF6GvCA+6gj7MTCsayaK9t0= +github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3Tr1ipoypjAUtc= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index 9d6c473f..96a80c99 100644 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -104,7 +104,7 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering node.Parent.Prev.Type == blackfriday.Heading && node.Parent.Prev.FirstChild != nil && bytes.EqualFold(node.Parent.Prev.FirstChild.Literal, []byte("NAME")) { - before, after, found := bytes.Cut(node.Literal, []byte(" - ")) + before, after, found := bytesCut(node.Literal, []byte(" - ")) escapeSpecialChars(w, before) if found { out(w, ` \- `) @@ -406,3 +406,12 @@ func escapeSpecialCharsLine(w io.Writer, text []byte) { w.Write([]byte{'\\', text[i]}) // nolint: errcheck } } + +// bytesCut is a copy of [bytes.Cut] to provide compatibility with go1.17 +// and older. We can remove this once we drop support for go1.17 and older. +func bytesCut(s, sep []byte) (before, after []byte, found bool) { + if i := bytes.Index(s, sep); i >= 0 { + return s[:i], s[i+len(sep):], true + } + return s, nil, false +} diff --git a/vendor/github.com/docker/cli-docs-tool/.golangci.yml b/vendor/github.com/docker/cli-docs-tool/.golangci.yml index 6c655717..56a199fd 100644 --- a/vendor/github.com/docker/cli-docs-tool/.golangci.yml +++ b/vendor/github.com/docker/cli-docs-tool/.golangci.yml @@ -3,7 +3,6 @@ run: linters: enable: - - deadcode - depguard - gofmt - goimports @@ -13,7 +12,6 @@ linters: - ineffassign - misspell - typecheck - - varcheck - errname - makezero - whitespace @@ -21,12 +19,11 @@ linters: linters-settings: depguard: - list-type: blacklist - include-go-root: true - packages: - # The io/ioutil package has been deprecated. - # https://go.dev/doc/go1.16#ioutil - - io/ioutil + rules: + main: + deny: + - pkg: io/ioutil + desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil importas: no-unaliased: true diff --git a/vendor/github.com/docker/cli-docs-tool/Dockerfile b/vendor/github.com/docker/cli-docs-tool/Dockerfile index f0e2739f..b075df29 100644 --- a/vendor/github.com/docker/cli-docs-tool/Dockerfile +++ b/vendor/github.com/docker/cli-docs-tool/Dockerfile @@ -14,20 +14,37 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION="1.18" -ARG GOLANGCI_LINT_VERSION="v1.45" -ARG ADDLICENSE_VERSION="v1.0.0" +ARG GO_VERSION="1.23" +ARG XX_VERSION="1.6.1" +ARG GOLANGCI_LINT_VERSION="v1.62" +ARG ADDLICENSE_VERSION="v1.1.1" ARG LICENSE_ARGS="-c cli-docs-tool -l apache" ARG LICENSE_FILES=".*\(Dockerfile\|\.go\|\.hcl\|\.sh\)" FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint -FROM ghcr.io/google/addlicense:${ADDLICENSE_VERSION} AS addlicense +FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx -FROM golang:${GO_VERSION}-alpine AS base +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base RUN apk add --no-cache cpio findutils git linux-headers ENV CGO_ENABLED=0 WORKDIR /src +COPY --link --from=xx / / + +FROM base AS addlicense +ARG ADDLICENSE_VERSION +ARG TARGETPLATFORM +RUN --mount=target=/root/.cache,type=cache \ + --mount=type=cache,target=/go/pkg/mod <&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"' - echo "$diff" - exit 1 -fi + set -e + git add -A + cp -rf /out/* . + diff=$(git status --porcelain -- go.mod go.sum) + if [ -n "$diff" ]; then + echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"' + echo "$diff" + exit 1 + fi EOT FROM base AS lint @@ -61,7 +78,7 @@ FROM base AS license-set ARG LICENSE_ARGS ARG LICENSE_FILES RUN --mount=type=bind,target=.,rw \ - --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ + --mount=from=addlicense,source=/out/addlicense,target=/usr/bin/addlicense \ find . -regex "${LICENSE_FILES}" | xargs addlicense ${LICENSE_ARGS} \ && mkdir /out \ && find . -regex "${LICENSE_FILES}" | cpio -pdm /out @@ -73,7 +90,7 @@ FROM base AS license-validate ARG LICENSE_ARGS ARG LICENSE_FILES RUN --mount=type=bind,target=. \ - --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ + --mount=from=addlicense,source=/out/addlicense,target=/usr/bin/addlicense \ find . -regex "${LICENSE_FILES}" | xargs addlicense -check ${LICENSE_ARGS} FROM vendored AS test diff --git a/vendor/github.com/docker/cli-docs-tool/clidocstool.go b/vendor/github.com/docker/cli-docs-tool/clidocstool.go index a9d2f649..5b25de00 100644 --- a/vendor/github.com/docker/cli-docs-tool/clidocstool.go +++ b/vendor/github.com/docker/cli-docs-tool/clidocstool.go @@ -65,7 +65,7 @@ func New(opts Options) (*Client, error) { } else { c.target = opts.TargetDir } - if err := os.MkdirAll(c.target, 0755); err != nil { + if err := os.MkdirAll(c.target, 0o755); err != nil { return nil, err } return c, nil diff --git a/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go b/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go index a35b62d7..46c2d093 100644 --- a/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go +++ b/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go @@ -94,7 +94,7 @@ func (c *Client) GenMarkdownTree(cmd *cobra.Command) error { }); err != nil { return err } - if err = os.WriteFile(targetPath, icBuf.Bytes(), 0644); err != nil { + if err = os.WriteFile(targetPath, icBuf.Bytes(), 0o644); err != nil { return err } } else if err := copyFile(sourcePath, targetPath); err != nil { diff --git a/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go b/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go index acf5f2ba..2add1e6c 100644 --- a/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go +++ b/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go @@ -77,7 +77,7 @@ type cmdDoc struct { // subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` // it is undefined which help output will be in the file `cmd-sub-third.1`. func (c *Client) GenYamlTree(cmd *cobra.Command) error { - emptyStr := func(s string) string { return "" } + emptyStr := func(string) string { return "" } if err := c.loadLongDescription(cmd, "yaml"); err != nil { return err } diff --git a/vendor/github.com/docker/cli-docs-tool/docker-bake.hcl b/vendor/github.com/docker/cli-docs-tool/docker-bake.hcl index 4a5f44f8..cfeef334 100644 --- a/vendor/github.com/docker/cli-docs-tool/docker-bake.hcl +++ b/vendor/github.com/docker/cli-docs-tool/docker-bake.hcl @@ -12,6 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["test"] } @@ -21,31 +27,37 @@ group "validate" { } target "lint" { + inherits = ["_common"] target = "lint" output = ["type=cacheonly"] } target "vendor-validate" { + inherits = ["_common"] target = "vendor-validate" output = ["type=cacheonly"] } target "vendor-update" { + inherits = ["_common"] target = "vendor-update" output = ["."] } target "test" { + inherits = ["_common"] target = "test-coverage" output = ["."] } target "license-validate" { + inherits = ["_common"] target = "license-validate" output = ["type=cacheonly"] } target "license-update" { + inherits = ["_common"] target = "license-update" output = ["."] } diff --git a/vendor/modules.txt b/vendor/modules.txt index 95e5615c..101124c9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -209,8 +209,8 @@ github.com/containerd/ttrpc # github.com/containerd/typeurl/v2 v2.2.3 ## explicit; go 1.21 github.com/containerd/typeurl/v2 -# github.com/cpuguy83/go-md2man/v2 v2.0.5 -## explicit; go 1.11 +# github.com/cpuguy83/go-md2man/v2 v2.0.6 +## explicit; go 1.12 github.com/cpuguy83/go-md2man/v2/md2man # github.com/creack/pty v1.1.21 ## explicit; go 1.13 @@ -253,7 +253,7 @@ github.com/docker/cli/cli/version github.com/docker/cli/opts github.com/docker/cli/pkg/kvfile github.com/docker/cli/templates -# github.com/docker/cli-docs-tool v0.8.0 +# github.com/docker/cli-docs-tool v0.9.0 ## explicit; go 1.18 github.com/docker/cli-docs-tool github.com/docker/cli-docs-tool/annotation