Skip to content

Commit

Permalink
types: add map PullOptions to the conf file
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed May 7, 2021
1 parent c2c9ca9 commit 7400647
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ type OptionsConfig struct {

// MountOpt specifies extra mount options used when mounting
MountOpt string `toml:"mountopt"`

// PullOptions specifies options to be handed to pull managers
// This API is experimental and can be changed without bumping the major version number.
PullOptions map[string]string `toml:"pull_options"`
}

// GetGraphDriverOptions returns the driver specific options
Expand Down
6 changes: 6 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ type StoreOptions struct {
AutoNsMinSize uint32 `json:"auto_userns_min_size,omitempty"`
// AutoNsMaxSize is the maximum size for an automatic user namespace.
AutoNsMaxSize uint32 `json:"auto_userns_max_size,omitempty"`
// PullOptions specifies options to be handed to pull managers
// This API is experimental and can be changed without bumping the major version number.
PullOptions map[string]string `toml:"pull_options"`
}

// isRootlessDriver returns true if the given storage driver is valid for containers running as non root
Expand Down Expand Up @@ -362,6 +365,9 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) {
if config.Storage.Options.AutoUsernsMaxSize > 0 {
storeOptions.AutoNsMaxSize = config.Storage.Options.AutoUsernsMaxSize
}
if config.Storage.Options.PullOptions != nil {
storeOptions.PullOptions = config.Storage.Options.PullOptions
}

storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, cfg.GetGraphDriverOptions(storeOptions.GraphDriverName, config.Storage.Options)...)

Expand Down

0 comments on commit 7400647

Please sign in to comment.