Skip to content
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

gitconsul deleting all keys from consul #128

Open
lpicanco opened this issue Dec 29, 2016 · 1 comment
Open

gitconsul deleting all keys from consul #128

lpicanco opened this issue Dec 29, 2016 · 1 comment

Comments

@lpicanco
Copy link

lpicanco commented Dec 29, 2016

I have the following files in my git repository:

application.yml
application-dev.yml

When i update application.yml, git2consul remove the application and application-dev keys from consul KV. I think the problem is this:

https://www.consul.io/docs/commands/kv/delete.html

!> **Trailing slashes are important** in the recursive delete operation, since
Consul performs a greedy match on the provided prefix. If you were to use "foo"
as the key, this would recursively delete any key starting with those letters
such as "foo", "food", and "football" not just "foo". To ensure you are deleting
a folder, always use a trailing slash.

It is not valid to combine the `-cas` option with `-recurse`, since you are
deleting multiple keys under a prefix in a single operation:

Log file

{"name":"git2consul","hostname":"75d604058676","pid":1,"level":10,"msg":"Attempting to read \"/tmp/app-config/config/master/application.yml\"","time":"2016-12-29T16:33:31.996Z","v":0}
{"name":"git2consul","hostname":"75d604058676","pid":1,"level":10,"msg":"Deleting key app-config/config/master/master/application","time":"2016-12-29T16:33:31.997Z","v":0}
{"name":"git2consul","hostname":"75d604058676","pid":1,"level":20,"msg":"Expandable file app-config/config/master/application yielded 42 keys","time":"2016-12-29T16:33:32.010Z","v":0}

My config file

{
  "version": "1.0",
  "logger" : {
    "name": "git2consul",
    "streams": [
      {
        "level": "trace",
        "stream": "process.stdout"
      }
    ]
  },
  "repos" : [{
    "name" : "app/config",
    "expand_keys" : true,
    "url" : "[email protected]:app/app-config.git",
    "ignore_file_extension": true,
    "expand_keys_diff" : true,
    "branches" : ["master"],
    "hooks": [{
      "type" : "polling",
      "interval" : "1"
    }]
  }
  ]
}

This can be related to #118

@eyalzek
Copy link
Contributor

eyalzek commented Jun 20, 2017

I was noticing the same behavior and submitted a PR that should fix this. It still requires a review since it might affect something I am not aware of.

#152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants