Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tehcyx committed Jun 4, 2023
2 parents 97afb1f + b90448f commit 57a4fac
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/comment-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
permissions:
pull-requests: 'write'
steps:
- uses: actions/github-script@v6
with:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The Terraform Provider for kind enables [Terraform](https://www.terraform.io) to
- [Using the provider](./docs/USAGE.md)
- [Provider development](./docs/DEVELOPMENT.md)

> **Note**
>
> For the `runtimeConfig` field there's special behaviour for options containing a `/` character. Since this is not allowed in HCL you can just use `_` which is internally replaced with a `/` for generating the kind config. E.g. for the option `api/alpha` you'd name the field `api_alpha` and it will set it to `api/alpha` when creating the corresponding kind config.
## Example Usage

Copy the following code into a file with the extension `.tf` to create a kind cluster with only default values.
Expand Down
4 changes: 2 additions & 2 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Requirements

- [Terraform](https://www.terraform.io/downloads.html) 0.12+
- [Go](https://golang.org/doc/install) 1.13 or higher
- [Go](https://golang.org/doc/install) 1.19 or higher
- Make sure that your Docker Engine has enough memory assigned to run multi-node kind clusters.

## Development
Expand All @@ -28,4 +28,4 @@ In order to test the provider you can run `go test ./...` for the unit tests as

In order to be able to release a new version this repository needs signed git commits when pushing a tag in order to pick that up and start a new goreleaser run.

To set this up on Windows, follow [this tutorial](https://tau.gr/posts/2018-06-29-how-to-set-up-signing-commits-with-git/).
To set this up on Windows, follow [this tutorial](https://tau.gr/posts/2018-06-29-how-to-set-up-signing-commits-with-git/).
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The Kind provider is used to interact with [Kubernetes IN Docker
(kind)](https://github.com/kubernetes-sigs/kind) to provision local
[Kubernetes](https://kubernetes.io) clusters.

> **Note**
>
> For the `runtimeConfig` field there's special behaviour for options containing a `/` character. Since this is not allowed in HCL you can just use `_` which is internally replaced with a `/` for generating the kind config. E.g. for the option `api/alpha` you'd name the field `api_alpha` and it will set it to `api/alpha` when creating the corresponding kind config.
## Example Usage

```hcl
Expand Down
12 changes: 12 additions & 0 deletions kind/schema_kind_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ func kindConfigNodeMountFields() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
},
"propagation": {
Type: schema.TypeString,
Optional: true,
},
"read_only": {
Type: schema.TypeBool,
Optional: true,
},
"selinux_relabel": {
Type: schema.TypeBool,
Optional: true,
},
}
return s
}
Expand Down
6 changes: 3 additions & 3 deletions kind/structure_kind_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ func flattenKindConfigExtraMounts(d map[string]interface{}) v1alpha4.Mount {
}
}

readonly := mapKeyIfExists(d, "readonly")
if readonly != nil {
obj.Readonly = readonly.(bool)
readOnly := mapKeyIfExists(d, "read_only")
if readOnly != nil {
obj.Readonly = readOnly.(bool)
}
selinuxRelabel := mapKeyIfExists(d, "selinux_relabel")
if selinuxRelabel != nil {
Expand Down

0 comments on commit 57a4fac

Please sign in to comment.