Skip to content

Commit

Permalink
Merge pull request #328 from ndeloof/network.external.name
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof authored Dec 19, 2022
2 parents c790067 + c5ef323 commit 5f02fe7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ func resolveVolumePath(volume types.ServiceVolumeConfig, workingDir string, look
}

func resolveSecretsPath(secret types.SecretConfig, workingDir string, lookupEnv template.Mapping) types.SecretConfig {
if ! secret.External.External && secret.File != "" {
if !secret.External.External && secret.File != "" {
secret.File = resolveMaybeUnixPath(secret.File, workingDir, lookupEnv)
}
return secret
Expand Down Expand Up @@ -741,7 +741,7 @@ func LoadNetworks(source map[string]interface{}) (map[string]types.NetworkConfig
if network.Name != "" {
return nil, errors.Errorf("network %s: network.external.name and network.name conflict; only use network.name", name)
}
logrus.Warnf("network %s: network.external.name is deprecated in favor of network.name", name)
logrus.Warnf("network %s: network.external.name is deprecated. Please set network.name with external: true", name)
network.Name = network.External.Name
network.External.Name = ""
case network.Name == "":
Expand Down
6 changes: 3 additions & 3 deletions loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ func TestLoadNetworksWarnOnDeprecatedExternalName(t *testing.T) {
},
}
assert.Check(t, is.DeepEqual(expected, networks))
assert.Check(t, strings.Contains(buf.String(), "network foo: network.external.name is deprecated in favor of network.name"))
assert.Check(t, strings.Contains(buf.String(), "network foo: network.external.name is deprecated. Please set network.name with external: true"))
}

func TestLoadNetworkInvalidExternalNameAndNameCombination(t *testing.T) {
Expand Down Expand Up @@ -1861,13 +1861,13 @@ func TestLoadWithExtends(t *testing.T) {
},
Environment: types.MappingWithEquals{},
Networks: map[string]*types.ServiceNetworkConfig{"default": nil},
Volumes: []types.ServiceVolumeConfig{{
Volumes: []types.ServiceVolumeConfig{{
Type: "bind",
Source: "/opt/data",
Target: "/var/lib/mysql",
Bind: &types.ServiceVolumeBind{CreateHostPath: true},
}},
Scale: 1,
Scale: 1,
},
}
assert.Check(t, is.DeepEqual(expServices, actual.Services))
Expand Down

0 comments on commit 5f02fe7

Please sign in to comment.