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

Support reading from symlinked files and dirs #105

Open
poblahblahblah opened this issue Oct 13, 2016 · 0 comments
Open

Support reading from symlinked files and dirs #105

poblahblahblah opened this issue Oct 13, 2016 · 0 comments

Comments

@poblahblahblah
Copy link

poblahblahblah commented Oct 13, 2016

Our current git2consul repo has the following structure:

production_uw1
production_ue1
staging_stg1
staging_stg2
staging_stg3

Our repos section of our git2consul config looks like this:

  "repos" : [{
    "name" : "git",
    "branches" : ["master"],
    "include_branch_name" : false,
    "source_root" : "staging_stg1",
    "url" : "[email protected]:goldstar/consul_data.git",
    "hooks": [{
      "type" : "polling",
      "interval" : "1"
    }]
  }]

The directory in the git repo that gets synced to /git in consul depends on what environment git2consul and consul are in. So if we're in the production uw1 AZ, then production_uw1 will get synced to /git in consul. This pattern has held up well so far, although we've recently been needing to introduce some data that would be shared across all environments.

We tried to add in a symlink like so:

global/foo/bar
production_uw1
...
staging_stg1/global -> ../global
...

We we're hoping this would work. It didn't. Admittedly this is kind of gross.

Version: 0.12.11
Error:

{"name":"git2consul","hostname":"ops.stg1.goldstarbeta.com","pid":27121,"level":50,"msg":"Failed to create repos due to Failed to load repo git due to Some consul updates failed:\nFailed to read key /var/lib/git2consul/cache/git/test-symlink/staging_stg1/global due to Error: EISDIR: illegal operation on a directory, read","time":"2016-10-13T19:58:39.759Z","v":0}

edit: I wanted to add that we worked around the issue, although I would still expect it to support symlinks, if at all possible. New configuration:

  "repos" : [
    {
      "name" : "git",
      "branches" : ["master"],
      "include_branch_name" : false,
      "source_root" : "staging_stg1",
      "url" : "[email protected]:goldstar/consul_data.git",
      "hooks": [{
        "type" : "polling",
        "interval" : "1"
      }]
    },
    {
      "name" : "git/global",
      "branches" : ["master"],
      "include_branch_name" : false,
      "source_root" : "global",
      "url" : "[email protected]:goldstar/consul_data.git",
      "hooks": [{
        "type" : "polling",
        "interval" : "1"
      }]
  }]
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

1 participant