()
| 79 | } |
| 80 | |
| 81 | func (e *External) Validate() error { |
| 82 | if e.ConfigFile != "" { |
| 83 | if !filepath.IsAbs(e.ConfigFile) { |
| 84 | return fmt.Errorf("path to config file must be an absolute path") |
| 85 | } |
| 86 | if _, err := os.Stat(e.ConfigFile); err != nil { |
| 87 | return fmt.Errorf("failed to access config file %s", e.ConfigFile) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | execPath, err := e.ExecutablePath() |
| 92 | if err != nil { |
| 93 | return fmt.Errorf("failed to get executable path: %w", err) |
| 94 | } |
| 95 | if _, err := os.Stat(execPath); err != nil { |
| 96 | return fmt.Errorf("failed to access external provider binary %s", execPath) |
| 97 | } |
| 98 | if !exec.IsExecutable(execPath) { |
| 99 | return fmt.Errorf("external provider binary %s is not executable", execPath) |
| 100 | } |
| 101 | |
| 102 | return nil |
| 103 | } |
nothing calls this directly
no test coverage detected