Skip to content

Commit c89e454

Browse files
committed
fix: volume was not generated
1 parent 604a3e0 commit c89e454

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/cmd/cmd.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ Then, with a single command, you create and start all the services from your con
4747
return err
4848
}
4949

50-
fmt.Println(b.String())
50+
// Remove null values in the yaml output
51+
output := strings.ReplaceAll(b.String(), " null", "")
52+
fmt.Println(output)
5153

5254
return nil
5355
},

pkg/compose/compose.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
type Compose struct {
1111
Services map[string]Service
12+
Volumes map[string]*string
1213
}
1314

1415
type Service struct {
@@ -34,14 +35,17 @@ func NewCompose(options ...Option) *Compose {
3435
ContainerName: "cockroachdb",
3536
Image: "cockroachdb/cockroach:v23.2.5",
3637
Ports: []string{"26257:26257", "8080:8080"},
37-
Volumes: []string{"cockroachdb:/cockroach/cockroach-data"},
38+
Volumes: []string{fmt.Sprintf("%s:/cockroach/cockroach-data", cockroachdbVolume)},
3839
Command: "start-single-node --cluster-name=node --insecure",
3940
},
4041
"core": {
4142
ContainerName: "core",
4243
Image: "rss3/node:latest",
4344
},
4445
},
46+
Volumes: map[string]*string{
47+
cockroachdbVolume: nil,
48+
},
4549
}
4650

4751
for _, option := range options {

0 commit comments

Comments
 (0)