diff --git a/cmd/sops/main.go b/cmd/sops/main.go index 834283644..0b5e4ce11 100644 --- a/cmd/sops/main.go +++ b/cmd/sops/main.go @@ -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 } diff --git a/cmd/sops/subcommand/updatekeys/updatekeys.go b/cmd/sops/subcommand/updatekeys/updatekeys.go index 394646287..3541dfa06 100644 --- a/cmd/sops/subcommand/updatekeys/updatekeys.go +++ b/cmd/sops/subcommand/updatekeys/updatekeys.go @@ -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 } diff --git a/config/config.go b/config/config.go index c540f9143..1ae6d8812 100644 --- a/config/config.go +++ b/config/config.go @@ -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)