Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 9dfeeb8

Browse files
Merge pull request #491 from simonferquel/move-back-to-cli-master
Bump docker/cli vendoring
2 parents e797c90 + e92335e commit 9dfeeb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1023
-1625
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ RUN apt-get install -y -q --no-install-recommends \
88

99
WORKDIR /go/src/github.com/docker/cli
1010

11-
RUN git clone https://github.com/chris-crone/cli . && git checkout d6bfd7e5592dad85969516c131d33910fa5ebd58
12-
# FIXME(ulyssessouza): Go back to the line below when PRs https://github.com/docker/cli/pull/1718 and https://github.com/docker/cli/pull/1690 hits the cli
13-
#RUN git clone https://github.com/docker/cli.git . && git checkout 8ddde26af67f9a76734a1676c635e48da4fe8584
11+
RUN git clone https://github.com/docker/cli . && git checkout 80918147ff32b0bf2a424d9133a45bab670793ff
1412

1513
RUN make cross binary && \
1614
cp build/docker-linux-amd64 /usr/bin/docker

Gopkg.lock

Lines changed: 5 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ required = ["github.com/wadey/gocovmerge"]
3636
source = "github.com/simonferquel/containerd"
3737
revision = "42c3614d58767e96c1752977fed94d0b140a0173"
3838

39-
### Waiting on PR https://github.com/docker/cli/pull/1718 and https://github.com/docker/cli/pull/1690 to land on cli ###
4039
[[override]]
4140
name = "github.com/docker/cli"
42-
source = "https://github.com/chris-crone/cli"
43-
revision="d6bfd7e5592dad85969516c131d33910fa5ebd58"
41+
branch = "master"
4442

4543
[[override]]
4644
name = "github.com/deislabs/duffle"

cmd/docker-app/main.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ import (
1111

1212
func main() {
1313
plugin.Run(func(dockerCli command.Cli) *cobra.Command {
14-
return app.NewRootCmd("app", dockerCli)
14+
cmd := app.NewRootCmd("app", dockerCli)
15+
originalPreRun := cmd.PersistentPreRunE
16+
cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
17+
if err := plugin.PersistentPreRunE(cmd, args); err != nil {
18+
return err
19+
}
20+
if originalPreRun != nil {
21+
return originalPreRun(cmd, args)
22+
}
23+
return nil
24+
}
25+
return cmd
1526
}, manager.Metadata{
1627
SchemaVersion: "0.1.0",
1728
Vendor: "Docker Inc.",

internal/store/store.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/pkg/errors"
1515
)
1616

17-
func storeBaseDir() string {
17+
func storeBaseDir() (string, error) {
1818
return config.Path("app-bundle-store")
1919
}
2020
func storePath(ref reference.Named) (string, error) {
@@ -29,8 +29,12 @@ func storePath(ref reference.Named) (string, error) {
2929
// when parsing the ref) then there will be errors when we try
3030
// to use this as a path later.
3131
name = strings.Replace(name, ":", "_", 1)
32+
baseDir, err := storeBaseDir()
33+
if err != nil {
34+
return "", err
35+
}
3236

33-
storeDir := filepath.Join(storeBaseDir(), filepath.FromSlash(name))
37+
storeDir := filepath.Join(baseDir, filepath.FromSlash(name))
3438

3539
// We rely here on _ not being valid in a name meaning there can be no clashes due to nesting of repositories.
3640
switch t := ref.(type) {

internal/store/store_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ func parseRefOrDie(t *testing.T, ref string) reference.Named {
1717

1818
func TestStorePath(t *testing.T) {
1919
testSha := "2957c6606cc94099f7dfe0011b5c8daf4a605ed6124d4eee773bab1e05a8ce87"
20-
basedir := storeBaseDir()
20+
basedir, err := storeBaseDir()
21+
assert.NilError(t, err)
2122
for _, tc := range []struct {
2223
Name string
2324
Ref reference.Named

vendor/github.com/Nvveen/Gotty/LICENSE

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)