mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
config comment for future changes
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user