package main
import (
- "crypto/x509"
"encoding/json"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/arvados"
"io"
"io/ioutil"
"log"
- "net/http"
"os"
"os/exec"
"os/signal"
return "", "", "", err
}
if taskp.KeepTmpOutput {
- // Is there an os.Copy?
- copyFile(v, outdir+"/"+k)
+ err = copyFile(v, outdir+"/"+k)
} else {
- os.Symlink(v, outdir+"/"+k)
+ err = os.Symlink(v, outdir+"/"+k)
+ }
+ if err != nil {
+ return "", "", "", err
}
}
}
return "", err
}
collection := arvados.Collection{}
- json.Unmarshal(buf, &collection)
- return collection.ManifestText, nil
+ err = json.Unmarshal(buf, &collection)
+ return collection.ManifestText, err
}
func runner(api IArvadosClient,
manifest, err = getKeepTmp(outdir)
} else {
manifest, err = WriteTree(kc, outdir)
- if err != nil {
- return TempFail{err}
- }
+ }
+ if err != nil {
+ return TempFail{err}
}
// Set status
log.Fatal(err)
}
- // Container may not have certificates installed, so need to look for
- // /etc/arvados/ca-certificates.crt in addition to normal system certs.
- var certFiles = []string{
- "/etc/ssl/certs/ca-certificates.crt", // Debian
- "/etc/pki/tls/certs/ca-bundle.crt", // Red Hat
- "/etc/arvados/ca-certificates.crt",
- }
-
- certs := x509.NewCertPool()
- for _, file := range certFiles {
- data, err := ioutil.ReadFile(file)
- if err == nil {
- log.Printf("Using TLS certificates at %v", file)
- certs.AppendCertsFromPEM(data)
- }
- }
- api.Client.Transport.(*http.Transport).TLSClientConfig.RootCAs = certs
-
jobUuid := os.Getenv("JOB_UUID")
taskUuid := os.Getenv("TASK_UUID")
tmpdir := os.Getenv("TASK_WORK")