Skip to content

Commit

Permalink
Fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
onee-only committed Jul 15, 2024
1 parent 77ce426 commit 0b49ef9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 16 additions & 12 deletions cmd/gen-work/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,25 @@ func processParameters() {
taskID = uuid.MustParse(*_taskID)
sectionID = uuid.MustParse(*_sectionID)

id := uuid.MustParse(*_templateID)
templateID = id[:]

kvPairs := strings.Split(*_headers, ",")
headerMap := make(map[string]string, len(kvPairs))
for _, pair := range kvPairs {
k, v, found := strings.Cut(pair, "=")
if !found {
log.Fatal("malformed header")
if *_templateID != "" {
id := uuid.MustParse(*_templateID)
templateID = id[:]
}

if *_headers != "" {
kvPairs := strings.Split(*_headers, ",")
headerMap := make(map[string]string, len(kvPairs))
for _, pair := range kvPairs {
k, v, found := strings.Cut(pair, "=")
if !found {
log.Fatal("malformed header")
}

headerMap[k] = v
}

headerMap[k] = v
headers = headerMap
}

headers = headerMap
}

func main() {
Expand Down
4 changes: 4 additions & 0 deletions internal/exec/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func (e *Executor) setupResources(
ExposedPorts: nat.PortSet{natPort: struct{}{}},
}

if resource.Name == "db" {
containerConf.Env = append(containerConf.Env, "MYSQL_ALLOW_EMPTY_PASSWORD=true")
}

hostConf := &container.HostConfig{
NetworkMode: container.NetworkMode(e.ExecNetwork),
Resources: container.Resources{
Expand Down

0 comments on commit 0b49ef9

Please sign in to comment.