mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add a registry package with registry v1/v2 code
This extract what was in registry_test.go and registry_mock_test.go. This also move `RegistryHosting` requirement to `registry.Hosting` Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
5374d53322
commit
4300e5e881
13 changed files with 168 additions and 123 deletions
12
integration-cli/registry/requirement.go
Normal file
12
integration-cli/registry/requirement.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package registry
|
||||
|
||||
import "os/exec"
|
||||
|
||||
// Hosting returns wether the host can host a registry (v2) or not
|
||||
func Hosting() bool {
|
||||
// for now registry binary is built only if we're running inside
|
||||
// container through `make test`. Figure that out by testing if
|
||||
// registry binary is in PATH.
|
||||
_, err := exec.LookPath(v2binary)
|
||||
return err == nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue