Skip to content

Commit 7b9b923

Browse files
author
Christian Weichel
committed
[env-mf] Remove Docker version from default env manifest entries
as that would make package versions dependent on a connection to a Docker daemon. As the environment manifest is resolved on workspace load one would always need a connection to a Docker daemon just to run e.g. leeway collect.
1 parent 7cb55f0 commit 7b9b923

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

pkg/leeway/workspace.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,16 @@ var defaultEnvManifestEntries = map[PackageType]EnvironmentManifest{
9898
{Name: "arch", Command: []string{builtinEnvManifestGOARCH}, Builtin: true},
9999
},
100100
GenericPackage: []EnvironmentManifestEntry{},
101-
DockerPackage: []EnvironmentManifestEntry{
102-
{Name: "docker", Command: []string{"docker", "version", "--format", "{{.Client.Version}} {{.Server.Version}}"}},
101+
DockerPackage: []EnvironmentManifestEntry{
102+
// We do not pull the docker version here as that would make package versions dependent on a connection
103+
// to a Docker daemon. As the environment manifest is resolved on workspace load one would always need
104+
// a connection to a Docker daemon just to run e.g. leeway collect.
105+
//
106+
// If you want the behaviour described above, add the following to your WORKSPACE.yaml:
107+
// environmentManifest:
108+
// - name: docker
109+
// command: ["docker", "version", "--format", "{{.Client.Version}} {{.Server.Version}}"]
110+
//
103111
},
104112
GoPackage: []EnvironmentManifestEntry{
105113
{Name: "go", Command: []string{"go", "version"}},

pkg/leeway/workspace_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestFixtureLoadWorkspace(t *testing.T) {
7575
},
7676
{
7777
Name: "environment manifest",
78-
T: t,
78+
T: t,
7979
Args: []string{"describe", "-w", "fixtures/nested-ws/wsa", "environment-manifest"},
8080
Eval: func(t *testing.T, stdout, stderr string) {
8181
for _, k := range []string{"os", "arch", "foobar"} {

0 commit comments

Comments
 (0)