Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@
/docs/vendor/
/docs/go.sum
profile.out

# top-level go.mod is not meant to be checked in
/go.mod
/go.sum
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
* text=auto

Dockerfile* linguist-language=Dockerfile
vendor.mod linguist-language=Go-Module
vendor.sum linguist-language=Go-Checksums

*.go -text diff=golang

Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ jobs:
with:
fetch-depth: 2
persist-credentials: false
# CodeQL 2.16.4's auto-build added support for multi-module repositories,
# and is trying to be smart by searching for modules in every directory,
# including vendor directories. If no module is found, it's creating one
# which is ... not what we want, so let's give it a "go.mod".
# see: https://github.com/docker/cli/pull/4944#issuecomment-2002034698
-
name: Create go.mod
run: |
ln -s vendor.mod go.mod
ln -s vendor.sum go.sum
-
name: Update Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ jobs:

host:
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}
GOBIN: ${{ github.workspace }}/bin
GO111MODULE: auto
strategy:
fail-fast: false
matrix:
Expand All @@ -62,7 +58,6 @@ jobs:
name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: ${{ env.GOPATH }}/src/github.com/docker/cli
persist-credentials: false
-
name: Set up Go
Expand All @@ -73,17 +68,12 @@ jobs:
-
name: Test
run: |
# run in go modules mode to prevent traversing to nested modules
ln -s vendor.mod go.mod
ln -s vendor.sum go.sum
go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/e2e/')
go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/v29/e2e/')
go tool cover -func=/tmp/coverage.txt
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
shell: bash
-
name: Send to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: /tmp/coverage.txt
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
token: ${{ secrets.CODECOV_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,3 @@ jobs:
shell: 'script --return --quiet --command "bash {0}"'
run: |
make -f docker.Makefile ${{ matrix.target }}

validate-gocompat:
runs-on: ubuntu-24.04
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: off
steps:
-
name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: src/github.com/docker/cli
persist-credentials: false
-
name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.26.8"
cache: false
-
name: Run gocompat check
shell: 'script --return --quiet --command "bash {0}"'
working-directory: ${{ github.workspace }}/src/github.com/docker/cli
run: |
make -C ./internal/gocompat verify
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ Thumbs.db
/cmd/docker/winresources/versioninfo.json
/cmd/docker/winresources/*.syso
profile.out

# top-level go.mod is not meant to be checked in
/go.mod
/go.sum
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ RUN --mount=type=bind,target=.,ro \

FROM build-${BASE_VARIANT} AS test
COPY --link --from=gotestsum /out/gotestsum /usr/bin/gotestsum
ENV GO111MODULE=auto
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod \
Expand Down
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
# Sets the name of the company that produced the windows binary.
PACKAGER_NAME ?=

# The repository doesn't have a go.mod, but "go list", and "gotestsum"
# expect to be run from a module.
GO111MODULE=auto
export GO111MODULE

all: binary

_:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS))
Expand Down Expand Up @@ -81,15 +76,15 @@ install-trust-plugin: ## install docker-trust CLI plugins
.PHONY: vendor
vendor: ## update vendor with go modules
rm -rf vendor
scripts/with-go-mod.sh scripts/vendor update
scripts/vendor update

.PHONY: validate-vendor
validate-vendor: ## validate vendor
scripts/with-go-mod.sh scripts/vendor validate
scripts/vendor validate

.PHONY: mod-outdated
mod-outdated: ## check outdated dependencies
scripts/with-go-mod.sh scripts/vendor outdated
scripts/vendor outdated

.PHONY: authors
authors: ## generate AUTHORS file from git history
Expand Down Expand Up @@ -124,15 +119,15 @@ shell-completion: ## generate shell-completion scripts

.PHONY: manpages
manpages: ## generate man pages from go source and markdown
scripts/with-go-mod.sh scripts/docs/generate-man.sh
scripts/docs/generate-man.sh

.PHONY: mddocs
mddocs: ## generate markdown files from go source
scripts/with-go-mod.sh scripts/docs/generate-md.sh
scripts/docs/generate-md.sh

.PHONY: yamldocs
yamldocs: ## generate documentation YAML files consumed by docs repo
scripts/with-go-mod.sh scripts/docs/generate-yaml.sh
scripts/docs/generate-yaml.sh

.PHONY: help
help: ## print this help
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker CLI

[![PkgGoDev](https://pkg.go.dev/badge/github.com/docker/cli)](https://pkg.go.dev/github.com/docker/cli)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/docker/cli/v29)](https://pkg.go.dev/github.com/docker/cli/v29)
[![Build Status](https://img.shields.io/github/actions/workflow/status/docker/cli/build.yml?branch=master&label=build&logo=github)](https://github.com/docker/cli/actions?query=workflow%3Abuild)
[![Test Status](https://img.shields.io/github/actions/workflow/status/docker/cli/test.yml?branch=master&label=test&logo=github)](https://github.com/docker/cli/actions?query=workflow%3Atest)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/docker/cli/badge)](https://scorecard.dev/viewer/?uri=github.com/docker/cli)
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Assertions should be made using
[gotest.tools/assert](https://godoc.org/gotest.tools/assert).

Fakes, and testing utilities can be found in
[internal/test](https://godoc.org/github.com/docker/cli/internal/test) and
[internal/test](https://pkg.go.dev/github.com/docker/cli/v29/internal/test) and
[gotest.tools](https://godoc.org/gotest.tools).

## End-to-End Test Suite
Expand Down
6 changes: 3 additions & 3 deletions cli-plugins/examples/helloworld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"os"

"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/cli-plugins/plugin"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/plugin"
"github.com/docker/cli/v29/cli/command"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
)
Expand Down
3 changes: 0 additions & 3 deletions cli-plugins/hooks/hook_types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

// Package hooks defines the contract between the Docker CLI and CLI plugin hook
// implementations.
//
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/hooks/hooks_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hooks_test
import (
"testing"

"github.com/docker/cli/cli-plugins/hooks"
"github.com/docker/cli/v29/cli-plugins/hooks"
)

func TestTemplateHelpers(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/hooks/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

"github.com/docker/cli/cli-plugins/hooks"
"github.com/docker/cli/v29/cli-plugins/hooks"
"gotest.tools/v3/assert"
)

Expand Down
3 changes: 0 additions & 3 deletions cli-plugins/hooks/template.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package hooks

import (
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/hooks/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hooks_test
import (
"testing"

"github.com/docker/cli/cli-plugins/hooks"
"github.com/docker/cli/v29/cli-plugins/hooks"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/manager/candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package manager
import (
"os/exec"

"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/metadata"
)

type candidate struct {
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/manager/candidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"testing"

"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
Expand Down
4 changes: 2 additions & 2 deletions cli-plugins/manager/cobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"sync"

"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/docker/cli/v29/cli/config"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/manager/cobra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"testing"

"github.com/docker/cli/internal/test"
"github.com/docker/cli/v29/internal/test"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
)
Expand Down
3 changes: 0 additions & 3 deletions cli-plugins/manager/error.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package manager

import (
Expand Down
9 changes: 3 additions & 6 deletions cli-plugins/manager/hooks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package manager

import (
Expand All @@ -11,9 +8,9 @@ import (
"strconv"
"strings"

"github.com/docker/cli/cli-plugins/hooks"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/v29/cli-plugins/hooks"
"github.com/docker/cli/v29/cli/config"
"github.com/docker/cli/v29/cli/config/configfile"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/manager/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/v29/cli/config/configfile"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
Expand Down
11 changes: 4 additions & 7 deletions cli-plugins/manager/manager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package manager

import (
Expand All @@ -14,10 +11,10 @@ import (
"sync"

"github.com/containerd/errdefs"
"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/debug"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/docker/cli/v29/cli/config"
"github.com/docker/cli/v29/cli/config/configfile"
"github.com/docker/cli/v29/cli/debug"
"github.com/fvbommel/sortorder"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
Expand Down
6 changes: 3 additions & 3 deletions cli-plugins/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"

"github.com/containerd/errdefs"
"github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/v29/cli/config"
"github.com/docker/cli/v29/cli/config/configfile"
"github.com/docker/cli/v29/internal/test"
"github.com/spf13/cobra"
"gotest.tools/v3/assert"
"gotest.tools/v3/fs"
Expand Down
7 changes: 2 additions & 5 deletions cli-plugins/manager/plugin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package manager

import (
Expand All @@ -15,8 +12,8 @@ import (
"strconv"
"strings"

"github.com/docker/cli/cli-plugins/hooks"
"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/hooks"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cli-plugins/manager/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"strings"

"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/spf13/cobra"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
Expand Down
15 changes: 6 additions & 9 deletions cli-plugins/plugin/plugin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.26

package plugin

import (
Expand All @@ -11,12 +8,12 @@ import (
"os"
"sync"

"github.com/docker/cli/cli"
"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/cli-plugins/socket"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/connhelper"
"github.com/docker/cli/cli/debug"
"github.com/docker/cli/v29/cli"
"github.com/docker/cli/v29/cli-plugins/metadata"
"github.com/docker/cli/v29/cli-plugins/socket"
"github.com/docker/cli/v29/cli/command"
"github.com/docker/cli/v29/cli/connhelper"
"github.com/docker/cli/v29/cli/debug"
"github.com/moby/moby/client"
"github.com/spf13/cobra"
"go.opentelemetry.io/otel"
Expand Down
Loading
Loading