diff --git a/worker/awsCertlint/awsCertlint.go b/worker/awsCertlint/awsCertlint.go index 52907b913..0576f4244 100644 --- a/worker/awsCertlint/awsCertlint.go +++ b/worker/awsCertlint/awsCertlint.go @@ -8,10 +8,12 @@ import ( "io/ioutil" "os" "os/exec" + "path/filepath" "strings" "time" "github.com/mozilla/tls-observatory/certificate" + "github.com/mozilla/tls-observatory/logger" "github.com/mozilla/tls-observatory/worker" ) @@ -20,6 +22,9 @@ var ( workerDesc = "Runs the awslabs certificate linter and saves output" certlintDirectory = "/go/certlint" // path from tools/Dockerfile-scanner + binaryPath = "bin/certlint" // path inside `certlintDirectory` + + log = logger.GetLogger() ) type Result struct { @@ -37,6 +42,14 @@ func init() { certlintDirectory = path } + // Verify code was pulled down + fullPath := filepath.Join(certlintDirectory, binaryPath) + _, err := os.Stat(fullPath) + if err != nil && os.IsNotExist(err) { + log.Printf("Could not find awslabs/certlint (tried %s), disabling worker\n", fullPath) + return + } + runner := new(eval) worker.RegisterWorker(workerName, worker.Info{Runner: runner, Description: workerDesc}) }