Skip to content

Commit

Permalink
config: pass down PullOptions from the storage configuration
Browse files Browse the repository at this point in the history
maintain the PullOptions as read from the storage.conf file, so that
we don't lose options like `convert_images` that are necessary to
convert existing images to a format usable with composefs.

Do not bother to expose this configuration in the crio drop-in
configuration as the PullOptions API is still experimental in
containers/storage.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe authored and kwilczynski committed Sep 27, 2024
1 parent f2c874d commit 738be3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ type RootConfig struct {
// StorageOption is a list of storage driver specific options.
StorageOptions []string `toml:"storage_option"`

// PullOptions is a map of pull options that are passed to the storage driver.
pullOptions map[string]string

// LogDir is the default log directory where all logs will go unless kubelet
// tells us to put them somewhere else.
LogDir string `toml:"log_dir"`
Expand Down Expand Up @@ -186,6 +189,7 @@ func (c *RootConfig) GetStore() (storage.Store, error) {
ImageStore: c.ImageStore,
GraphDriverName: c.Storage,
GraphDriverOptions: c.StorageOptions,
PullOptions: c.pullOptions,
})
}

Expand Down Expand Up @@ -863,6 +867,7 @@ func DefaultConfig() (*Config, error) {
ImageStore: storeOpts.ImageStore,
Storage: storeOpts.GraphDriverName,
StorageOptions: storeOpts.GraphDriverOptions,
pullOptions: storeOpts.PullOptions,
LogDir: "/var/log/crio/pods",
VersionFile: CrioVersionPathTmp,
CleanShutdownFile: CrioCleanShutdownFile,
Expand Down Expand Up @@ -1059,6 +1064,7 @@ func (c *RootConfig) Validate(onExecution bool) error {
c.Root = store.GraphRoot()
c.Storage = store.GraphDriverName()
c.StorageOptions = store.GraphOptions()
c.pullOptions = store.PullOptions()
}

return nil
Expand Down

0 comments on commit 738be3c

Please sign in to comment.