mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
Rename runnerConfig
This commit is contained in:
@@ -350,7 +350,7 @@ func templateRunner(tmpls []*structs.Template, config *config.Config,
|
||||
}
|
||||
|
||||
// Create the runner configuration.
|
||||
runnerConfig, err := runnerConfig(config, vaultToken, ctmplMapping)
|
||||
runnerConfig, err := newRunnerConfig(config, vaultToken, ctmplMapping)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -423,11 +423,11 @@ func parseTemplateConfigs(tmpls []*structs.Template, taskDir string,
|
||||
return ctmpls, nil
|
||||
}
|
||||
|
||||
// runnerConfig returns a consul-template runner configuration, setting the
|
||||
// newRunnerConfig returns a consul-template runner configuration, setting the
|
||||
// Vault and Consul configurations based on the clients configs. The parameters
|
||||
// are the client config, Vault token if set and the mapping of consul-templates
|
||||
// to Nomad templates.
|
||||
func runnerConfig(config *config.Config, vaultToken string,
|
||||
func newRunnerConfig(config *config.Config, vaultToken string,
|
||||
templateMapping map[ctconf.TemplateConfig]*structs.Template) (*ctconf.Config, error) {
|
||||
|
||||
conf := ctconf.DefaultConfig()
|
||||
|
||||
@@ -1063,7 +1063,7 @@ func TestTaskTemplateManager_Config_ServerName(t *testing.T) {
|
||||
Addr: "https://localhost/",
|
||||
TLSServerName: "notlocalhost",
|
||||
}
|
||||
ctconf, err := runnerConfig(c, "token", nil)
|
||||
ctconf, err := newRunnerConfig(c, "token", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ func TestTaskTemplateManager_Config_VaultGrace(t *testing.T) {
|
||||
ctmplMapping, err := parseTemplateConfigs(templates, "/fake/dir", taskEnv, false)
|
||||
assert.Nil(err, "Parsing Templates")
|
||||
|
||||
ctconf, err := runnerConfig(c, "token", ctmplMapping)
|
||||
ctconf, err := newRunnerConfig(c, "token", ctmplMapping)
|
||||
assert.Nil(err, "Building Runner Config")
|
||||
assert.NotNil(ctconf.Vault.Grace, "Vault Grace Pointer")
|
||||
assert.Equal(10*time.Second, *ctconf.Vault.Grace, "Vault Grace Value")
|
||||
|
||||
Reference in New Issue
Block a user