Skip to content

Commit

Permalink
Merge pull request #2 from schoology/Bool-bugfix
Browse files Browse the repository at this point in the history
(bug-fix) - Fixing bool type error + updating Readme and example
  • Loading branch information
sammarx authored Mar 12, 2020
2 parents b5e5330 + 518a2b4 commit 7a15e16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Building The Provider
Clone repository to: `$GOPATH/src/github.com/schoology/terraform-provider-consul-yaml`

```sh
$ mkdir -p $GOPATH/src/github.com/schoology; cd $GOPATH/src/github.com/schoology
$ git clone git@github.com:schoology/terraform-provider-consul-yaml
$ mkdir -p $GOPATH/src/schoology; cd $GOPATH/src/schoology
$ git clone https://github.com/schoology/terraform-provider-consul-yaml.git
```

Enter the provider directory and build the provider
Expand All @@ -37,14 +37,8 @@ Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
Once you have compiled the provider you can find binary in the `$GOPATH/bin` directory. To test with Terraform you will need to move the binary to your local plugin directory, located at `%APPDATA%\terraform.d\plugins` on Windows and `~/.terraform.d/plugins` on other systems.

```sh
$ make bin
...
$ $GOPATH/bin/terraform-provider-consul-yaml
...
```

In order to test the provider, you can simply run `make test`.

Expand Down
4 changes: 4 additions & 0 deletions consulyaml/resource_consul_key_prefix_from_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func parseMapItem(item yaml.MapItem, subKeys map[string]string, parent string) {
case int:
// if we see an int, convert it to a string
subKeys[key] = strconv.Itoa(v)
case bool:
// if we see an bool, convert it to a string
subKeys[key] = strconv.FormatBool(v)

case yaml.MapSlice:
parseMapSlice(v, subKeys, key)
case nil:
Expand Down
10 changes: 8 additions & 2 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
provider "consul" {
address = "127.0.0.1:8300"
datacenter = "dc1"
}


resource "consul-yaml" "app" {
datacenter = "dc1"

path_prefix = "prefix_test/"
subkeys_file = "../consulyaml/test-fixtures/cheese.yam"
path_prefix = "test/"
subkeys_file = "subkeys.yaml"
}

0 comments on commit 7a15e16

Please sign in to comment.