Coder Social home page Coder Social logo

Explain `[ path ...]` about consulator HOT 4 OPEN

prologic avatar prologic commented on July 20, 2024
Explain `[ path ...]`

from consulator.

Comments (4)

lewispeckover avatar lewispeckover commented on July 20, 2024 1

If a path is specified, file extensions are used to determine the format.
If reading from stdin, you need to specify the format.

This way you can simply point consulator at a file/directory, or, you can just pipe to it directly from a git archive or curl .. or whatever.

from consulator.

prologic avatar prologic commented on July 20, 2024

So to be clear; the following are exactly equivalent:

$ cat foo.yaml | consulator import -yaml

and:

$ consulator import foo.yaml

?

As well as for example:

$ mkdir -p foo
$ cat > foo/foo.yaml <<EOF
foo: bar
EOH
$ consulator import ./foo/

from consulator.

lewispeckover avatar lewispeckover commented on July 20, 2024

Mostly :)

When you specify a directory rather than a specific file, the relative paths of files within it are used as part of the resulting key names.

For example, given a directory structure like this:
./abc/def/xyz.yaml
with xyz.yaml containing foo: bar

consulator import ./ would result in a key path of "abc/def/xyz/foo: bar
consulator import ./abc would result in a key path of "def/xyz/foo: bar

For your examples, the first two would have a key path of just foo: bar whereas the last one would end up as foo/foo: bar due to the foo.yaml filename.

consulator dump is useful for testing things like this without polluting or needing to run consul.

from consulator.

prologic avatar prologic commented on July 20, 2024

from consulator.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.