1
0
mirror of https://github.com/mayflower/docker-ls.git synced 2025-11-28 00:01:09 +03:00

Add an option for ignoring SSL cert errors.

This commit is contained in:
Christian Speckner
2016-02-26 13:46:27 +01:00
parent 1eae834b66
commit 15f18a28c2
5 changed files with 30 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ type Config struct {
pageSize uint
maxConcurrentRequests uint
basicAuth bool
allowInsecure bool
}
func (u *urlValue) String() string {
@@ -47,6 +48,7 @@ func (c *Config) BindToFlags(flags *flag.FlagSet) {
flags.UintVar(&c.pageSize, "page-size", c.pageSize, "page size for paginated requests")
flags.UintVar(&c.maxConcurrentRequests, "max-requests", c.maxConcurrentRequests, "concurrent API request limit")
flags.BoolVar(&c.basicAuth, "basic-auth", c.basicAuth, "use basic auth instead of token auth")
flags.BoolVar(&c.allowInsecure, "allow-insecure", c.allowInsecure, "ignore SSL certificate validation errors")
c.credentials.BindToFlags(flags)
}
@@ -59,6 +61,10 @@ func (c *Config) Credentials() auth.RegistryCredentials {
return &c.credentials
}
func (c *Config) AllowInsecure() bool {
return c.allowInsecure
}
func NewConfig() Config {
return Config{
registryUrl: DEFAULT_REGISTRY_URL,