Browse Source

Unquote volume names in creation events

Volumes are the only resources that are quoted, and only on creation.

Signed-off-by: Roberto Villarreal <[email protected]>
Roberto Villarreal 3 months ago
parent
commit
04b8ac5fe4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      pkg/compose/create.go
  2. 1 1
      pkg/e2e/up_test.go

+ 1 - 1
pkg/compose/create.go

@@ -1623,7 +1623,7 @@ func (s *composeService) removeDivergedVolume(ctx context.Context, name string,
 }
 
 func (s *composeService) createVolume(ctx context.Context, volume types.VolumeConfig) error {
-	eventName := fmt.Sprintf("Volume %q", volume.Name)
+	eventName := fmt.Sprintf("Volume %s", volume.Name)
 	w := progress.ContextWriter(ctx)
 	w.Event(progress.CreatingEvent(eventName))
 	hash, err := VolumeHash(volume)

+ 1 - 1
pkg/e2e/up_test.go

@@ -175,7 +175,7 @@ func TestUpWithAllResources(t *testing.T) {
 	})
 
 	res := c.RunDockerComposeCmd(t, "-f", "./fixtures/resources/compose.yaml", "--all-resources", "--project-name", projectName, "up")
-	assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Volume "%s_my_vol"  Created`, projectName)), res.Combined())
+	assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Volume %s_my_vol  Created`, projectName)), res.Combined())
 	assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Network %s_my_net  Created`, projectName)), res.Combined())
 }