diff --git a/CHANGELOG.md b/CHANGELOG.md index cede06684b08..3917fdef234d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,10 @@ __BACKWARDS INCOMPATIBILITIES:__ IMPROVEMENTS: * core: A set of features (Autopilot) has been added to allow for automatic operator-friendly management of Nomad servers. For more information about Autopilot, see the [Autopilot Guide](https://www.nomadproject.io/guides/cluster/autopilot.html). [[GH-3670](https://github.com/hashicorp/nomad/pull/3670)] + * client: Allow '.' in environment variable names [[GH-3760](https://github.com/hashicorp/nomad/issues/3760)] * discovery: Allow `check_restart` to be specified in the `service` stanza. [[GH-3718](https://github.com/hashicorp/nomad/issues/3718)] - * driver/lxc: Add volumes config to LXC driver [GH-3687] + * driver/lxc: Add volumes config to LXC driver [[GH-3687](https://github.com/hashicorp/nomad/issues/3687)] BUG FIXES: * core: Fix search endpoint forwarding for multi-region clusters [[GH-3680](https://github.com/hashicorp/nomad/issues/3680)] diff --git a/helper/funcs.go b/helper/funcs.go index e66ff40d1a1a..49b300c24d59 100644 --- a/helper/funcs.go +++ b/helper/funcs.go @@ -263,6 +263,7 @@ func CleanEnvVar(s string, r byte) string { for i, c := range b { switch { case c == '_': + case c == '.': case c >= 'a' && c <= 'z': case c >= 'A' && c <= 'Z': case i > 0 && c >= '0' && c <= '9': diff --git a/helper/funcs_test.go b/helper/funcs_test.go index 564765c627c6..774030be1711 100644 --- a/helper/funcs_test.go +++ b/helper/funcs_test.go @@ -66,7 +66,8 @@ func TestClearEnvVar(t *testing.T) { {"asd0", "asd0"}, {"_asd", "_asd"}, {"-asd", "_asd"}, - {"A~!@#$%^&*()_+-={}[]|\\;:'\"<,>.?/Z", "A_______________________________Z"}, + {"asd.fgh", "asd.fgh"}, + {"A~!@#$%^&*()_+-={}[]|\\;:'\"<,>?/Z", "A______________________________Z"}, {"A\U0001f4a9Z", "A____Z"}, } for _, c := range cases { diff --git a/vendor/github.com/hashicorp/go-envparse/envparse.go b/vendor/github.com/hashicorp/go-envparse/envparse.go index de29a8479393..29d43f594aec 100644 --- a/vendor/github.com/hashicorp/go-envparse/envparse.go +++ b/vendor/github.com/hashicorp/go-envparse/envparse.go @@ -5,7 +5,7 @@ // // KEY=value // -// While extraneous characters are discouraged, an "export" prefix, preceeding +// While extraneous characters are discouraged, an "export" prefix, preceding // whitespace, and trailing whitespace are all removed: // // KEY = This is ok! # Parses to {"KEY": "This is ok!"} @@ -135,11 +135,12 @@ func parseLine(ln []byte) ([]byte, []byte, error) { for _, v := range key[1:] { switch { case v == '_': + case v == '.': case v >= 'A' && v <= 'Z': case v >= 'a' && v <= 'z': case v >= '0' && v <= '9': default: - return nil, nil, fmt.Errorf("key characters must be [A-Za-z0-9_] but found %q", v) + return nil, nil, fmt.Errorf("key characters must be [A-Za-z0-9_.] but found %q", v) } } @@ -152,7 +153,7 @@ func parseLine(ln []byte) ([]byte, []byte, error) { // Scratch buffer for unescaped value newv := make([]byte, len(value)) newi := 0 - // Track last significant character for trimming unquoted whitespace preceeding a trailing comment + // Track last significant character for trimming unquoted whitespace preceding a trailing comment lastSig := 0 // Parser State diff --git a/vendor/vendor.json b/vendor/vendor.json index 3140acf8b7d5..98dcbcce0606 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -134,7 +134,7 @@ {"path":"github.com/hashicorp/errwrap","revision":"7554cd9344cec97297fa6649b055a8c98c2a1e55"}, {"path":"github.com/hashicorp/go-checkpoint","checksumSHA1":"D267IUMW2rcb+vNe3QU+xhfSrgY=","revision":"1545e56e46dec3bba264e41fde2c1e2aa65b5dd4","revisionTime":"2017-10-09T17:35:28Z"}, {"path":"github.com/hashicorp/go-cleanhttp","checksumSHA1":"6ihdHMkDfFx/rJ1A36com2F6bQk=","revision":"a45970658e51fea2c41445ff0f7e07106d007617","revisionTime":"2017-02-11T00:33:01Z"}, - {"path":"github.com/hashicorp/go-envparse","checksumSHA1":"mB5JzxaVCPIvbwADY0acdnkhmT8=","revision":"7953113a2936d8e5f7e2a0a3dd8089565c39ef21","revisionTime":"2017-06-02T22:43:19Z"}, + {"path":"github.com/hashicorp/go-envparse","checksumSHA1":"FKmqR4DC3nCXtnT9pe02z5CLNWo=","revision":"310ca1881b22af3522e3a8638c0b426629886196","revisionTime":"2018-01-19T21:58:41Z"}, {"path":"github.com/hashicorp/go-getter","checksumSHA1":"wCKbbnwvVEoKAE5TWunloLhErm4=","revision":"994f50a6f071b07cfbea9eca9618c9674091ca51","revisionTime":"2017-12-04T19:28:26Z"}, {"path":"github.com/hashicorp/go-getter/helper/url","checksumSHA1":"9J+kDr29yDrwsdu2ULzewmqGjpA=","revision":"994f50a6f071b07cfbea9eca9618c9674091ca51","revisionTime":"2017-12-04T19:28:26Z"}, {"path":"github.com/hashicorp/go-hclog","checksumSHA1":"miVF4/7JP0lRwZvFJGKwZWk7aAQ=","revision":"b4e5765d1e5f00a0550911084f45f8214b5b83b9","revisionTime":"2017-07-16T17:45:23Z"},