-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KV Import fails on Windows using Consul version 1.10.0 #10583
Comments
Thank you for reporting this issue and identifying the problem! I think that line you identified needs to change to use |
dnephin
added
theme/kv
Issues related to the key value store
type/bug
Feature does not function as expected
labels
Jul 9, 2021
blake
added a commit
that referenced
this issue
Aug 10, 2021
Consul 1.10 (PR #9792) introduced the ability to specify a prefix when importing KV's. This however introduced a regression on Windows systems which breaks `kv import`. The key name is joined with specified`-prefix` using `filepath.Join()` which uses a forward slash (/) to delimit values on Unix-based systems, and a backslash (\) to delimit values on Windows – the latter of which is incompatible with Consul KV paths. This commit replaces filepath.Join() with path.Join() which uses a forward slash as the delimiter, providing consistent key join behavior across supported operating systems. Fixes #10583
blake
added a commit
that referenced
this issue
Aug 10, 2021
Consul 1.10 (PR #9792) introduced the ability to specify a prefix when importing KV's. This however introduced a regression on Windows systems which breaks `kv import`. The key name is joined with specified`-prefix` using `filepath.Join()` which uses a forward slash (/) to delimit values on Unix-based systems, and a backslash (\) to delimit values on Windows – the latter of which is incompatible with Consul KV paths. This commit replaces filepath.Join() with path.Join() which uses a forward slash as the delimiter, providing consistent key join behavior across supported operating systems. Fixes #10583
hc-github-team-consul-core
pushed a commit
that referenced
this issue
Aug 10, 2021
Consul 1.10 (PR #9792) introduced the ability to specify a prefix when importing KV's. This however introduced a regression on Windows systems which breaks `kv import`. The key name is joined with specified`-prefix` using `filepath.Join()` which uses a forward slash (/) to delimit values on Unix-based systems, and a backslash (\) to delimit values on Windows – the latter of which is incompatible with Consul KV paths. This commit replaces filepath.Join() with path.Join() which uses a forward slash as the delimiter, providing consistent key join behavior across supported operating systems. Fixes #10583
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Consul KV import fails using version 1.10.0 when running under Windows.
This is due to the change made to this line:
consul/command/kv/imp/kv_import.go
Line 82 in 13bd865
in this pull request: https://github.com/hashicorp/consul/pull/9792/files#diff-4b09e89bd0587b4486d7a8c6e36e86b4dbc1253737775c39e593ab09020ff3c7R82
Unfortunately this means that all keys are imported with backslashes (\) rather than forward slashes (/), as can be seen below.
Steps to Reproduce
With version 1.10.0 of consul:
consul kv import @consuldata.json
which gives the following output
Imported: prefix\KeyField1\KeyField2
consul kv export
which gives the following output
Expected Behaviour
With version 1.9.5 of consul:
consul kv import @consuldata.json
which gives the following output
Imported: prefix/KeyField1/KeyField2
consul kv export
which gives the following output
The text was updated successfully, but these errors were encountered: