opendevstack/tailor

parallel execution of tailor (e.g. to build / deploy) errors out with `error: Cannot stat ".combined.env"`

clemensutschig opened this issue · 1 comments

if len(actualParamFiles) > 0 {
paramFileBytes, err := readParamFileBytes(
actualParamFiles,
compareOptions.PrivateKey,
compareOptions.Passphrase,
)
if err != nil {
return []byte{}, err
}
tempParamFile := ".combined.env"
defer os.Remove(tempParamFile)
cli.DebugMsg("Writing contents of param files into", tempParamFile)
err = ioutil.WriteFile(tempParamFile, paramFileBytes, 0644)
if err != nil {
return []byte{}, err
}
args = append(args, "--param-file="+tempParamFile)
}

bets on a file named .combined.env - which is later deleted .. in parallel cases, like the below ...

parallel (
  'couper': {
    buildImage(context, "couper", "couper", tailorSelBase+"-couper")
  },
  'acservice': {
    buildImage(context, "acservice", "ac-service", tailorSelBase+"-ac-service")
  },
  'dataservice': {
    buildImage(context, "dataservice", "data-service", tailorSelBase+"-data-service")
  },
  'pptservice': {
    buildImage(context, "pptexportservice", "pptexport-service", tailorSelBase+"-pptexport-service")
  },
  failFast: true
)

you'll get an error:

+ tailor --non-interactive -n ahdm-dev apply --selector service=..... --param ODS_OPENSHIFT_APP_DOMAIN=...... --preserve bc:/spec/output/imageLabels --preserve bc:/spec/output/to/name --ignore-unknown-parameters bc,is
error: Cannot stat ".combined.env": stat .combined.env: no such file or directory

Comparing templates in . with OCP namespace ahdm-dev.