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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user