Skip to content

Commit 5481ea6

Browse files
committed
fix: don't block forever in Pipe.Confirm when stdin has no data
Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
1 parent baaaaa3 commit 5481ea6

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

pkg/compose/publish_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,32 @@ func Test_preChecks_sensitive_data_detected_decline(t *testing.T) {
134134
assert.Equal(t, accept, false)
135135
}
136136

137+
func Test_preChecks_bind_mount_skipped_with_assume_yes(t *testing.T) {
138+
project := &types.Project{
139+
Services: types.Services{
140+
"web": {
141+
Name: "web",
142+
Image: "nginx",
143+
Volumes: []types.ServiceVolumeConfig{
144+
{
145+
Type: types.VolumeTypeBind,
146+
Source: "/host/path",
147+
Target: "/container/path",
148+
},
149+
},
150+
},
151+
},
152+
}
153+
154+
svc := &composeService{
155+
prompt: AlwaysOkPrompt(),
156+
}
157+
158+
accept, err := svc.preChecks(t.Context(), project, api.PublishOptions{})
159+
assert.NilError(t, err)
160+
assert.Equal(t, accept, true)
161+
}
162+
137163
func Test_publish_decline_returns_ErrCanceled(t *testing.T) {
138164
project := &types.Project{
139165
Services: types.Services{

0 commit comments

Comments
 (0)