mirror of https://github.com/docker/compose.git
set filesystem name to make it more visible on AWS web console
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
5d5765173e
commit
a87300d1df
|
@ -200,6 +200,7 @@ func (b *ecsAPIService) parseExternalVolumes(ctx context.Context, project *types
|
|||
return nil, err
|
||||
}
|
||||
if id == "" {
|
||||
tags["Name"] = fmt.Sprintf("%s_%s", project.Name, vol.Name)
|
||||
logrus.Debug("no EFS filesystem found, create a fresh new one")
|
||||
id, err = b.aws.CreateFileSystem(ctx, tags)
|
||||
if err != nil {
|
||||
|
|
|
@ -384,10 +384,6 @@ volumes:
|
|||
}
|
||||
|
||||
func TestCreateVolume(t *testing.T) {
|
||||
tags := map[string]string{
|
||||
compose.ProjectTag: t.Name(),
|
||||
compose.VolumeTag: "db-data",
|
||||
}
|
||||
testVolume(t, `
|
||||
services:
|
||||
test:
|
||||
|
@ -395,16 +391,19 @@ services:
|
|||
volumes:
|
||||
db-data: {}
|
||||
`, useDefaultVPC, func(m *MockAPIMockRecorder) {
|
||||
m.FindFileSystem(gomock.Any(), tags).Return("", nil)
|
||||
m.CreateFileSystem(gomock.Any(), tags).Return("fs-123abc", nil)
|
||||
m.FindFileSystem(gomock.Any(), map[string]string{
|
||||
compose.ProjectTag: t.Name(),
|
||||
compose.VolumeTag: "db-data",
|
||||
}).Return("", nil)
|
||||
m.CreateFileSystem(gomock.Any(), map[string]string{
|
||||
compose.ProjectTag: t.Name(),
|
||||
compose.VolumeTag: "db-data",
|
||||
"Name": fmt.Sprintf("%s_%s", t.Name(), "db-data"),
|
||||
}).Return("fs-123abc", nil)
|
||||
})
|
||||
}
|
||||
|
||||
func TestReusePreviousVolume(t *testing.T) {
|
||||
tags := map[string]string{
|
||||
compose.ProjectTag: t.Name(),
|
||||
compose.VolumeTag: "db-data",
|
||||
}
|
||||
testVolume(t, `
|
||||
services:
|
||||
test:
|
||||
|
@ -412,7 +411,10 @@ services:
|
|||
volumes:
|
||||
db-data: {}
|
||||
`, useDefaultVPC, func(m *MockAPIMockRecorder) {
|
||||
m.FindFileSystem(gomock.Any(), tags).Return("fs-123abc", nil)
|
||||
m.FindFileSystem(gomock.Any(), map[string]string{
|
||||
compose.ProjectTag: t.Name(),
|
||||
compose.VolumeTag: "db-data",
|
||||
}).Return("fs-123abc", nil)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue