-
Notifications
You must be signed in to change notification settings - Fork 19
/
driver.go
30 lines (27 loc) · 1.06 KB
/
driver.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import "fmt"
type DojoDriverInterface interface {
HandleRun(mergedConfig Config, runID string, envService EnvServiceInterface) int
CleanAfterRun(mergedConfig Config, runID string) int
HandlePull(mergedConfig Config) int
HandleSignal(mergedConfig Config, runID string) int
HandleMultipleSignal(mergedConfig Config, runID string) int
}
func warnGeneral(fileService FileServiceInterface, config Config, envService EnvServiceInterface, logger *Logger) {
if fileService.FileExists(config.WorkDirOuter) {
if fileService.GetFileUid(config.WorkDirOuter) == 0 {
logger.Log("warn", fmt.Sprintf(
"WorkDirOuter: %s is owned by root, which is not recommended", config.WorkDirOuter))
}
} else {
logger.Log("warn", fmt.Sprintf(
"WorkDirOuter: %s does not exist", config.WorkDirOuter))
}
if !fileService.FileExists(config.IdentityDirOuter) {
logger.Log("warn", fmt.Sprintf(
"IdentityDirOuter: %s does not exist", config.IdentityDirOuter))
}
if envService.IsCurrentUserRoot() {
logger.Log("warn", "Current user is root, which is not recommended")
}
}