1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

Rename LoadForFile to LoadCreationRuleForFile (#663)

This commit is contained in:
Martin Litvaj
2020-05-04 22:58:45 +02:00
committed by GitHub
parent e4abd871c7
commit 99adfaed0b
3 changed files with 5 additions and 5 deletions

View File

@@ -1071,7 +1071,7 @@ func loadConfig(c *cli.Context, file string, kmsEncryptionContext map[string]*st
return nil, nil
}
}
conf, err := config.LoadForFile(configPath, file, kmsEncryptionContext)
conf, err := config.LoadCreationRuleForFile(configPath, file, kmsEncryptionContext)
if err != nil {
return nil, err
}

View File

@@ -44,7 +44,7 @@ func updateFile(opts Opts) error {
if err != nil {
return err
}
conf, err := config.LoadForFile(opts.ConfigPath, opts.InputPath, make(map[string]*string))
conf, err := config.LoadCreationRuleForFile(opts.ConfigPath, opts.InputPath, make(map[string]*string))
if err != nil {
return err
}

View File

@@ -323,10 +323,10 @@ func parseCreationRuleForFile(conf *configFile, filePath string, kmsEncryptionCo
return config, nil
}
// LoadForFile load the configuration for a given SOPS file from the config file at confPath. A kmsEncryptionContext
// LoadCreationRuleForFile load the configuration for a given SOPS file from the config file at confPath. A kmsEncryptionContext
// should be provided for configurations that do not contain key groups, as there's no way to specify context inside
// a SOPS config file outside of key groups.
func LoadForFile(confPath string, filePath string, kmsEncryptionContext map[string]*string) (*Config, error) {
func LoadCreationRuleForFile(confPath string, filePath string, kmsEncryptionContext map[string]*string) (*Config, error) {
conf, err := loadConfigFile(confPath)
if err != nil {
return nil, err
@@ -334,7 +334,7 @@ func LoadForFile(confPath string, filePath string, kmsEncryptionContext map[stri
return parseCreationRuleForFile(conf, filePath, kmsEncryptionContext)
}
// LoadDestinationRuleForFile works the same as LoadForFile, but gets the "creation_rule" from the matching destination_rule's
// LoadDestinationRuleForFile works the same as LoadCreationRuleForFile, but gets the "creation_rule" from the matching destination_rule's
// "recreation_rule".
func LoadDestinationRuleForFile(confPath string, filePath string, kmsEncryptionContext map[string]*string) (*Config, error) {
conf, err := loadConfigFile(confPath)