config comment for future changes

This commit is contained in:
Lang Martin
2019-04-25 16:47:03 -04:00
parent c8fd0be03c
commit 6aa98c37ae
2 changed files with 12 additions and 4 deletions

View File

@@ -24,6 +24,14 @@ import (
)
// Config is the configuration for the Nomad agent.
//
// time.Duration values have two parts:
// - a string field tagged with an hcl:"foo" and json:"-"
// - a time.Duration field in the same struct and a call to duration
// in config_parse.go ParseConfigFile
//
// All config structs should have an ExtraKeysHCL field to check for
// unexpected keys
type Config struct {
// Region is the region this agent is in. Defaults to global.
Region string `hcl:"region"`

View File

@@ -351,7 +351,7 @@ var nonoptConfig = &Config{
func TestConfig_Parse(t *testing.T) {
t.Parallel()
// inconsequential changes to parsed data
// Inconsequential changes to parsed data
basicConfig.Telemetry.CollectionInterval = "" // tmp field to hold the string value
pluginConfig.addDefaults()
nonoptConfig.addDefaults()
@@ -444,7 +444,7 @@ func (c *Config) addDefaults() {
}
}
// this tests for a panic parsing json with an object of exactly
// Tests for a panic parsing json with an object of exactly
// length 1 described in
// https://github.com/hashicorp/nomad/issues/1290
func TestConfig_ParsePanic(t *testing.T) {
@@ -461,8 +461,8 @@ func TestConfig_ParsePanic(t *testing.T) {
require.EqualValues(t, c, d)
}
// this tests for top level keys left by hcl when parsing slices in
// the config structure
// Top level keys left by hcl when parsing slices in the config
// structure should not be unexpected
func TestConfig_ParseSliceExtra(t *testing.T) {
c, err := ParseConfigFile("./testdata/config-slices.json")
if err != nil {