feat(cli): Added command line arguments for overriding storage type and storage config - #42
feat(cli): Added command line arguments for overriding storage type and storage config#42anandf wants to merge 1 commit into
Conversation
| logger.Info("env overrides for dex storage", | ||
| "DEX_STORAGE_TYPE", os.Getenv("DEX_STORAGE_TYPE"), | ||
| "DEX_STORAGE_CONFIG", os.Getenv("DEX_STORAGE_CONFIG"), | ||
| ) |
There was a problem hiding this comment.
this may log some credentials for other storage type if provided, better we can ignore it or log only type.
| defer s.Close() | ||
|
|
||
| logger.Info("config storage", "storage_type", c.Storage.Type) | ||
| logger.Info("config storage", "storage_config", c.Storage.Config) |
| } | ||
| config.Storage.Type = options.storageType | ||
| storageConfig := f() | ||
| if len(options.storageConfig) != 0 { |
There was a problem hiding this comment.
in next iteration, what if storage type is change, but not config. the options still has new storage type and old config which may cause problem for dex pod to start
There was a problem hiding this comment.
storageConfig := f()
if len(options.storageConfig) != 0 {
// expand + unmarshal
}
config.Storage.Type = options.storageType
config.Storage.Config = storageConfig
|
|
||
| err = applyConfigOverrides(options, &c) | ||
| if err != nil { | ||
| return fmt.Errorf("error overriding values for storage type %q and storage config %q: %v", options.storageType, options.storageConfig, err) |
There was a problem hiding this comment.
this can also leak if any credentials exist in config
| if !ok { | ||
| return fmt.Errorf("unknown storage type %q", options.storageType) | ||
| } | ||
| config.Storage.Type = options.storageType |
There was a problem hiding this comment.
we can have this at last, where we are appending config, if unmarshal fails it will be partial setting.
0607f61 to
ce237b7
Compare
…nd storage config Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
ce237b7 to
76d4d57
Compare
No description provided.