diff --git a/cmd/gen-work/main.go b/cmd/gen-work/main.go index ab2d517..edb34c4 100644 --- a/cmd/gen-work/main.go +++ b/cmd/gen-work/main.go @@ -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() { diff --git a/internal/exec/resource.go b/internal/exec/resource.go index c3fc56f..36c28f3 100644 --- a/internal/exec/resource.go +++ b/internal/exec/resource.go @@ -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{