-
Notifications
You must be signed in to change notification settings - Fork 1
/
no.go
47 lines (34 loc) · 977 Bytes
/
no.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package registry
import (
"fmt"
"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/buildtool/build-tools/pkg/docker"
)
type NoDockerRegistry struct{}
func (n NoDockerRegistry) Configured() bool {
return true
}
func (n NoDockerRegistry) Name() string {
return "No docker registry"
}
func (n NoDockerRegistry) Login(client docker.Client) error {
log.Debugf("Authentication <yellow>not supported</yellow> for registry <green>%s</green>\n", n.Name())
return nil
}
func (n NoDockerRegistry) GetAuthConfig() types.AuthConfig {
return types.AuthConfig{}
}
func (n NoDockerRegistry) GetAuthInfo() string {
return ""
}
func (n NoDockerRegistry) RegistryUrl() string {
return "noregistry"
}
func (n NoDockerRegistry) Create(repository string) error {
return nil
}
func (n NoDockerRegistry) PushImage(client docker.Client, auth, image string) error {
return fmt.Errorf("push not supported by registry")
}
var _ Registry = &NoDockerRegistry{}