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:
Nicolas De Loof 2020-10-13 15:04:01 +02:00
parent 5d5765173e
commit a87300d1df
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 14 additions and 11 deletions

View File

@ -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 {

View File

@ -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)
})
}