Skip to content

Commit

Permalink
Rename LoadForFile to LoadCreationRuleForFile (getsops#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamahl19 authored and rochaporto committed Jun 22, 2020
1 parent 25237c5 commit 13789ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/sops/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/sops/subcommand/updatekeys/updatekeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,18 @@ 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
}
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)
Expand Down

0 comments on commit 13789ea

Please sign in to comment.