Skip to content

Commit

Permalink
fix: Skip Mock DFS config parsing if not set
Browse files Browse the repository at this point in the history
Signed-off-by: jay-dee7 <[email protected]>
  • Loading branch information
jay-dee7 committed Dec 21, 2023
1 parent 124cf89 commit fe467c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ func setDefaultsForDatabaseStore(cfg *OpenRegistryConfig) {
}

func parseAndSetMockStorageDriverOptions(cfg *OpenRegistryConfig) {
mockConfig := viper.GetStringMap("dfs.mock")
keys := make([]string, 0, len(mockConfig))
for k := range mockConfig {
keys = append(keys, k)
}

// skip is mock config is absent
if len(keys) == 0 {
return
}
mockDFSType := viper.GetString("dfs.mock.type")
if mockDFSType == "MemMapped" {
viper.Set("dfs.mock.type", MockStorageBackendMemMapped)
Expand Down

0 comments on commit fe467c5

Please sign in to comment.