requirement.go 344 B

123456789101112
  1. package registry
  2. import "os/exec"
  3. // Hosting returns wether the host can host a registry (v2) or not
  4. func Hosting() bool {
  5. // for now registry binary is built only if we're running inside
  6. // container through `make test`. Figure that out by testing if
  7. // registry binary is in PATH.
  8. _, err := exec.LookPath(v2binary)
  9. return err == nil
  10. }