loadConfig will look for an existing config file, either provided through the command line, or using findConfigFile Since a config file is not required, this function does not error when one is not found, and instead returns a nil config pointer
(c *cli.Context, file string, kmsEncryptionContext map[string]*string)
| 2519 | // loadConfig will look for an existing config file, either provided through the command line, or using findConfigFile |
| 2520 | // Since a config file is not required, this function does not error when one is not found, and instead returns a nil config pointer |
| 2521 | func loadConfig(c *cli.Context, file string, kmsEncryptionContext map[string]*string) (*config.Config, error) { |
| 2522 | var err error |
| 2523 | configPath := c.GlobalString("config") |
| 2524 | if configPath == "" { |
| 2525 | // Ignore config not found errors returned from findConfigFile since the config file is not mandatory |
| 2526 | configPath, err = findConfigFile() |
| 2527 | if err != nil { |
| 2528 | // If we can't find a config file, but we were not explicitly requested to, assume it does not exist |
| 2529 | return nil, nil |
| 2530 | } |
| 2531 | } |
| 2532 | conf, err := config.LoadCreationRuleForFile(configPath, file, kmsEncryptionContext) |
| 2533 | if err != nil { |
| 2534 | return nil, err |
| 2535 | } |
| 2536 | return conf, nil |
| 2537 | } |
| 2538 | |
| 2539 | func shamirThreshold(c *cli.Context, file string, optionalConfig *config.Config) (int, error) { |
| 2540 | if c.Int("shamir-secret-sharing-threshold") != 0 { |
no test coverage detected
searching dependent graphs…