Giter Club home page Giter Club logo

terraform-provider-kind's Introduction

Terraform Provider for kind

Overview

The Terraform Provider for kind enables Terraform to provision local Kubernetes clusters on base of Kubernetes IN Docker (kind).

Quick Starts

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.

provider "kind" {}

resource "kind_cluster" "default" {
    name = "test-cluster"
}

Then run terraform init, terraform plan & terraform apply and follow the on screen instructions. For more details on how to influence creation of the kind resource check out the Quick Start section above.

terraform-provider-kind's People

Contributors

a-thaler avatar brandonros avatar cspengl avatar dependabot[bot] avatar jackflukinger avatar jrhouston avatar jwillebrands avatar keisukeyamashita avatar nickjj avatar nicokratky avatar pst avatar shaneramey avatar tehcyx avatar unicell avatar w9n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

terraform-provider-kind's Issues

Question: `kind_load` resource?

Is there any interest in supporting a kind_load resource, that takes an image reference and kind cluster name, and loads it?

resource "kind_load" "alpine" {
  image   = "alpine"
  cluster = "test-cluster"
}

If you're interested I might be willing to contribute this, as it could be useful in some of our testing.

bug: crash after upgrading to new version

Hello, thank you for maintaining this project ! After upgrading it, I go the following issue:

╷
│ Error: Request cancelled
│
│   with module.kind.kind_cluster.cluster,
│   on .terraform/modules/kind/main.tf line 1, in resource "kind_cluster" "cluster":
│    1: resource "kind_cluster" "cluster" {
│
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

Stack trace from the terraform-provider-kind plugin:

panic: interface conversion: interface {} is map[string]interface {}, not map[string]string

goroutine 46 [running]:
github.com/tehcyx/terraform-provider-kind/kind.flattenKindConfig(0xc00056ae30?)
        github.com/tehcyx/terraform-provider-kind/kind/structure_kind_config.go:45 +0x5bf
github.com/tehcyx/terraform-provider-kind/kind.resourceKindClusterCreate(0x0?, {0x0, 0x0})
        github.com/tehcyx/terraform-provider-kind/kind/resource_cluster.go:120 +0x2e5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x109d6d0?, {0x109d6d0?, 0xc0002a6c60?}, 0xd?, {0x0?, 0x0?})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0006841c0, {0x109d6d0, 0xc0002a6c60}, 0xc00025fa00, 0xc0002fcf00, {0x0, 0x0})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000700000, {0x109d6d0?, 0xc0002a6b40?}, 0xc0002e4370)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0003e8000, {0x109d6d0?, 0xc0002a6150?}, 0xc0002261c0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xecf5e0?, 0xc0003e8000}, {0x109d6d0, 0xc0002a6150}, 0xc000226070, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002501e0, {0x10a1c60, 0xc000102340}, 0xc0003ee120, 0xc0004901b0, 0x16d2720, 0x0)
        google.golang.org/[email protected]/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc0002501e0, {0x10a1c60, 0xc000102340}, 0xc0003ee120, 0x0)
        google.golang.org/[email protected]/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:963 +0x28a

Error: The terraform-provider-kind plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

For the timebeing, I rolled back to version 0.0.17.
Here is the terraform code I use:

variable "cluster_name" {
  description = "The name to give to the cluster."
  type        = string
  default     = "kind"
}

variable "kubernetes_version" {
  description = "Kubernetes version to use for the KinD cluster (images available https://hub.docker.com/r/kindest/node/tags[here])."
  type        = string
  default     = "v1.26.0"
}

variable "nodes" {
  description = "List of nodes"
  type        = list(map(string))
  default = [
    {
      "platform" = "my-platform"
    },
    {
      "platform" = "my-platform"
    },
    {
      "platform" = "my-platform"
    }
  ]
}

resource "kind_cluster" "cluster" {
  name = var.cluster_name

  node_image = "kindest/node:${var.kubernetes_version}"

  kind_config {
    kind        = "Cluster"
    api_version = "kind.x-k8s.io/v1alpha4"

    node {
      role = "control-plane"
    }

    dynamic "node" {
      for_each = var.nodes
      content {
        role   = "worker"
        labels = node.value
      }
    }
  }
}

Let me know if you need more information on my side ;)

Investigate why GH Action commenter is failing on 3rd party request

Commenter failed here #23 with a 403 error:

Run actions/github-script@v3
  with:
    github-token: ***
    script: var fs = require('fs');
  const ev = JSON.parse(
    fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')
  )
  var issue_number = ev.pull_request.number
  await github.issues.createComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: issue_number,
    body: 'Thank you for the PR! A maintainer will have to add the `ok-to-test` label to run tests before this can get merged.'
  });
  
    debug: false
    user-agent: actions/github-script
    result-encoding: json
RequestError [HttpError]: Resource not accessible by integration
Error: Unhandled error: HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/actions/github-script/v3/dist/index.js:[2](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:2)[3](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:3)[4](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:4)2:23
    at processTicksAndRejections (internal/process/task_queues.js:97:[5](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:5))
    at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:[6](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:6)120:56), <anonymous>:6:1)
    at async main (/home/runner/work/_actions/actions/github-script/v3/dist/index.js:614[7](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:7):20) {
  status: 403,
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-[8](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:8)',
    date: 'Tue, 22 Nov 2022 1[9](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:9):30:21 GMT',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'GitHub.com',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'transfer-encoding': 'chunked',
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-media-type': 'github.v3',
    'x-github-request-id': '0400:117B:2F36FB4:604833D:637D234D',
    'x-ratelimit-limit': '[10](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:10)00',
    'x-ratelimit-remaining': '999',
    'x-ratelimit-reset': '1669149021',
    'x-ratelimit-resource': 'core',
    'x-ratelimit-used': '1',
    'x-xss-protection': '0'
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/tehcyx/terraform-provider-kind/issues/23/comments',
    headers: {
      accept: 'application/vnd.github.-preview+json',
      'user-agent': 'actions/github-script octokit-core.js/3.2.1 Node.js/[12](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:12).[22](https://github.com/tehcyx/terraform-provider-kind/actions/runs/3518001764/jobs/5914472840#step:2:23).7 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"body":"Thank you for the PR! A maintainer will have to add the `ok-to-test` label to run tests before this can get merged."}',
    request: { agent: [Agent], hook: [Function: bound bound register] }
  },
  documentation_url: 'https://docs.github.com/rest/reference/issues#create-an-issue-comment'
}

bug: pr tester fails but reports as working

Got below output from a PR test run [1] [2] which marked the test as successful but had a failure in there.

Click me
Run make testacc
./before-commit.sh testacc

USER:  + runner
PATH:  + /home/runner/go/bin:/opt/hostedtoolcache/go/1.19.9/x6[4](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:5)/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GOPATH: +

go: downloading github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
go: downloading github.com/pelletier/go-toml v1.9.[5](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:6)
go: downloading k8s.io/client-go v0.20.2
go: downloading sigs.k8s.io/kind v0.18.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b[6](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:7)320
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/hashicorp/terraform-plugin-go v0.14.3
go: downloading github.com/hashicorp/terraform-plugin-log v0.8.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/mitchellh/go-testing-interface v1.14.1
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/crypto v0.[7](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:8).0
go: downloading k[8](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:9)s.io/apimachinery v0.20.2
go: downloading k8s.io/klog/v2 v2.4.0
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading github.com/hashicorp/go-hclog v1.4.0
go: downloading github.com/hashicorp/terraform-exec v0.18.1
go: downloading github.com/hashicorp/terraform-json v0.16.0
go: downloading github.com/hashicorp/go-uuid v1.0.3
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/hashicorp/go-plugin v1.4.8
go: downloading golang.org/x/text v0.8.0
go: downloading github.com/vmihailenco/msgpack v4.0.4+incompatible
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/vmihailenco/msgpack/v4 v4.3.12
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.0.2
go: downloading github.com/stretchr/testify v1.7.2
go: downloading golang.org/x/net v0.8.0
go: downloading github.com/google/gofuzz v1.1.0
go: downloading k8s.io/api v0.20.2
go: downloading github.com/go-logr/logr v0.2.0
go: downloading golang.org/x/term v0.6.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pkg/errors v0.[9](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:10).1
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading github.com/alessio/shellescape v1.4.1
go: downloading github.com/spf13/cobra v1.4.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/hashicorp/hc-install v0.5.0
go: downloading github.com/zclconf/go-cty v1.13.1
go: downloading github.com/hashicorp/hcl/v2 v2.16.2
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/hashicorp/yamux v0.0.0-2018[10](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:11)12175058-2f1d1f20f75d
go: downloading github.com/oklog/run v1.0.0
go: downloading google.golang.org/grpc v1.51.0
go: downloading github.com/jhump/protoreflect v1.6.0
go: downloading google.golang.org/appengine v1.6.7
go: downloading gopkg.in/check.v1 v1.0.0-2020[11](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:12)30134442-10cb98267c6c
go: downloading github.com/vmihailenco/tagparser v0.1.1
go: downloading github.com/hashicorp/logutils v1.0.0
go: downloading github.com/json-iterator/go v1.1.11
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
go: downloading golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
go: downloading k8s.io/utils v0.0.0-20201110183641-67b214c5f920
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading golang.org/x/sys v0.6.0
go: downloading github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/agext/levenshtein v1.2.2
go: downloading github.com/apparentlymart/go-textseg/v13 v13.0.0
go: downloading github.com/mitchellh/go-wordwrap v1.0.0
go: downloading github.com/go-test/deep v1.0.3
go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/kylelemons/godebug v1.1.0
go: downloading github.com/hashicorp/go-checkpoint v0.5.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
go: downloading github.com/hashicorp/terraform-registry-address v0.1.0
go: downloading github.com/modern-go/concurrent v0.0.0-201803060[12](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:13)644-bacd9c7ef1dd
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/BurntSushi/toml v1.0.0
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading golang.org/x/mod v0.8.0
go: downloading github.com/go-git/go-git/v5 v5.4.2
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
go: downloading github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
go: downloading github.com/ProtonMail/go-crypto v0.0.0-2021042814[13](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:14)23-04723f9f07d7
go: downloading github.com/go-git/go-billy/v5 v5.3.1
go: downloading github.com/sergi/go-diff v1.2.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/emirpasic/gods v1.12.0
go: downloading github.com/acomagu/bufpipe v1.0.3
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d[14](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:15)ea06fba99
go: downloading github.com/go-git/gcfg v1.5.0
go: downloading github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351
go: downloading github.com/xanzy/ssh-agent v0.3.0
go: downloading gopkg.in/warnings.v0 v0.1.2
go: downloading github.com/Microsoft/go-winio v0.4.16
√ go mod tidy
√ go build (dev)
? go mod verify
√ go mod verify
? go test
?   	github.com/tehcyx/terraform-provider-kind	[no test files]
ok  	github.com/tehcyx/terraform-provider-kind/kind	0.013s
√ go test
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccCluster
=== PAUSE TestAccCluster
=== RUN   TestAccClusterConfigBase
=== PAUSE TestAccClusterConfigBase
=== RUN   TestAccClusterConfigNodes
=== PAUSE TestAccClusterConfigNodes
=== RUN   TestAccClusterContainerdPatches
=== PAUSE TestAccClusterContainerdPatches
=== RUN   TestAccContainerdPatchFormatOnlyChangeIsNoop
=== PAUSE TestAccContainerdPatchFormatOnlyChangeIsNoop
=== RUN   TestNormalizeTomlString
=== RUN   TestNormalizeTomlString/WellFormattedIsReturnedAsIs
=== RUN   TestNormalizeTomlString/MalformedInputResultsInErrorAndReturnsInput
=== RUN   TestNormalizeTomlString/UnformattedInputIsFormatted
--- PASS: TestNormalizeTomlString (0.00s)
    --- PASS: TestNormalizeTomlString/WellFormattedIsReturnedAsIs (0.00s)
    --- PASS: TestNormalizeTomlString/MalformedInputResultsInErrorAndReturnsInput (0.00s)
    --- PASS: TestNormalizeTomlString/UnformattedInputIsFormatted (0.00s)
=== RUN   TestStringIsValidToml
=== RUN   TestStringIsValidToml/PassingNonStringIsAnError
=== RUN   TestStringIsValidToml/ValidTomlIsValid
=== RUN   TestStringIsValidToml/NilIsInvalid
=== RUN   TestStringIsValidToml/EmptyStringIsValid
=== RUN   TestStringIsValidToml/InvalidTomlIsInvalid
--- PASS: TestStringIsValidToml (0.00s)
    --- PASS: TestStringIsValidToml/PassingNonStringIsAnError (0.00s)
    --- PASS: TestStringIsValidToml/ValidTomlIsValid (0.00s)
    --- PASS: TestStringIsValidToml/NilIsInvalid (0.00s)
    --- PASS: TestStringIsValidToml/EmptyStringIsValid (0.00s)
    --- PASS: TestStringIsValidToml/InvalidTomlIsInvalid (0.00s)
=== CONT  TestAccCluster
Creating cluster "tf-acc-cluster-test-7096491684796679949" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-7096491684796679949-control-plane"]
Creating cluster "tf-acc-cluster-test-7096491684796679949" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-7096491684796679949-control-plane"]
Creating cluster "tf-acc-cluster-test-7096491684796679949" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after [15](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:16)s 💚
Deleted nodes: ["tf-acc-cluster-test-709649[16](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:17)84796679949-control-plane"]
Creating cluster "tf-acc-cluster-test-7096491684796679949" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-7096491684796679949-control-plane"]
Creating cluster "tf-acc-cluster-test-7096491684796679949" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 14s 💚
Deleted nodes: ["tf-acc-cluster-test-7096491684796679949-control-plane"]
--- PASS: TestAccCluster (202.34s)
=== CONT  TestAccClusterContainerdPatches
panic: interface conversion: interface {} is map[string]interface {}, not map[string]string

goroutine 3668 [running]:
github.com/tehcyx/terraform-provider-kind/kind.flattenKindConfig(0xc0002d0e30?)
	/home/runner/work/terraform-provider-kind/terraform-provider-kind/kind/structure_kind_config.go:45 +0x5bf
github.com/tehcyx/terraform-provider-kind/kind.resourceKindClusterCreate(0x0?, {0x0, 0x0})
	/home/runner/work/terraform-provider-kind/terraform-provider-kind/kind/resource_cluster.go:120 +0x2e5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1244590?, {0x1244590?, 0xc00032aae0?}, 0xd?, {0x0?, 0x0?})
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x[17](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:18)8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000164b60, {0x1244590, 0xc00032aae0}, 0xc0002e9a00, 0xc000238a00, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00037bae8, {0x1244590?, 0xc00032aa20?}, 0xc0001b03c0)
	/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002b4960, {0x1244590?, 0xc000547830?}, 0xc0001ba0e0)
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:8[18](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:19) +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1036a20?, 0xc0002b4960}, {0x1244590, 0xc000547830}, 0xc0001ba070, 0x0)
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00047e780, {0x1248fe0, 0xc0001b7380}, 0xc00014afc0, 0xc000546780, 0x[19](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:20)32dc0, 0x0)
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00047e780, {0x1248fe0, 0xc0001b7380}, 0xc00014afc0, 0x0)
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:963 +0x28a
FAIL	github.com/tehcyx/terraform-provider-kind/kind	[20](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:21)2.[68](https://github.com/tehcyx/terraform-provider-kind/actions/runs/5004406777/jobs/8966937127?pr=37#step:4:69)1s
FAIL
√ go fmt
√ go vet ./kind/...

same for a second test:

Click me
Run make testacc
./before-commit.sh testacc

USER:  + runner
PATH:  + /home/runner/go/bin:/opt/hostedtoolcache/go/1.19.9/x6[4](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:5)/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GOPATH: +

go: downloading github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
go: downloading github.com/pelletier/go-toml v1.9.[5](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:6)
go: downloading k8s.io/client-go v0.20.2
go: downloading sigs.k8s.io/kind v0.18.0
go: downloading github.com/hashicorp/go-hclog v1.4.0
go: downloading github.com/hashicorp/go-plugin v1.4.8
go: downloading github.com/hashicorp/terraform-plugin-go v0.14.3
go: downloading github.com/mitchellh/go-testing-interface v1.14.1
go: downloading github.com/google/go-cmp v0.5.9
go: downloading github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b[6](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:7)320
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/hashicorp/terraform-plugin-log v0.8.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/crypto v0.[7](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:8).0
go: downloading k[8](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:9)s.io/apimachinery v0.20.2
go: downloading k8s.io/klog/v2 v2.4.0
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading github.com/hashicorp/terraform-exec v0.18.1
go: downloading github.com/hashicorp/terraform-json v0.16.0
go: downloading github.com/hashicorp/go-uuid v1.0.3
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading github.com/stretchr/testify v1.7.2
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
go: downloading github.com/oklog/run v1.0.0
go: downloading golang.org/x/net v0.8.0
go: downloading google.golang.org/grpc v1.51.0
go: downloading github.com/jhump/protoreflect v1.6.0
go: downloading golang.org/x/text v0.8.0
go: downloading github.com/vmihailenco/msgpack v4.0.4+incompatible
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/vmihailenco/msgpack/v4 v4.3.12
go: downloading github.com/hashicorp/go-version v1.6.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading golang.org/x/term v0.6.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.0.2
go: downloading github.com/google/gofuzz v1.1.0
go: downloading k8s.io/api v0.20.2
go: downloading github.com/go-logr/logr v0.2.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pkg/errors v0.[9](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:10).1
go: downloading github.com/alessio/shellescape v1.4.1
go: downloading github.com/spf13/cobra v1.4.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/hashicorp/hc-install v0.5.0
go: downloading github.com/hashicorp/hcl/v2 v2.16.2
go: downloading github.com/zclconf/go-cty v1.13.1
go: downloading golang.org/x/sys v0.6.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading google.golang.org/genproto v0.0.0-202[10](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:11)602131652-f16073e35f0c
go: downloading github.com/hashicorp/terraform-registry-address v0.1.0
go: downloading google.golang.org/appengine v1.6.7
go: downloading gopkg.in/check.v1 v1.0.0-2020[11](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:12)30134442-10cb98267c6c
go: downloading github.com/vmihailenco/tagparser v0.1.1
go: downloading github.com/hashicorp/logutils v1.0.0
go: downloading github.com/json-iterator/go v1.1.11
go: downloading golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
go: downloading golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
go: downloading k8s.io/utils v0.0.0-20201110183641-67b214c5f920
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/agext/levenshtein v1.2.2
go: downloading github.com/apparentlymart/go-textseg/v13 v13.0.0
go: downloading github.com/mitchellh/go-wordwrap v1.0.0
go: downloading github.com/go-test/deep v1.0.3
go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/kylelemons/godebug v1.1.0
go: downloading github.com/hashicorp/go-checkpoint v0.5.0
go: downloading github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/modern-go/concurrent v0.0.0-201803060[12](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:13)644-bacd9c7ef1dd
go: downloading github.com/BurntSushi/toml v1.0.0
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading golang.org/x/mod v0.8.0
go: downloading github.com/go-git/go-git/v5 v5.4.2
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
go: downloading github.com/ProtonMail/go-crypto v0.0.0-2021042814[13](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:14)23-04723f9f07d7
go: downloading github.com/go-git/go-billy/v5 v5.3.1
go: downloading github.com/sergi/go-diff v1.2.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/emirpasic/gods v1.12.0
go: downloading github.com/acomagu/bufpipe v1.0.3
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d[14](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:15)ea06fba99
go: downloading github.com/go-git/gcfg v1.5.0
go: downloading github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351
go: downloading github.com/xanzy/ssh-agent v0.3.0
go: downloading gopkg.in/warnings.v0 v0.1.2
go: downloading github.com/Microsoft/go-winio v0.4.16
√ go mod tidy
√ go build (dev)
? go mod verify
√ go mod verify
? go test
?   	github.com/tehcyx/terraform-provider-kind	[no test files]
ok  	github.com/tehcyx/terraform-provider-kind/kind	0.011s
√ go test
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccCluster
=== PAUSE TestAccCluster
=== RUN   TestAccClusterConfigBase
=== PAUSE TestAccClusterConfigBase
=== RUN   TestAccClusterConfigNodes
=== PAUSE TestAccClusterConfigNodes
=== RUN   TestAccClusterContainerdPatches
=== PAUSE TestAccClusterContainerdPatches
=== RUN   TestAccContainerdPatchFormatOnlyChangeIsNoop
=== PAUSE TestAccContainerdPatchFormatOnlyChangeIsNoop
=== RUN   TestNormalizeTomlString
=== RUN   TestNormalizeTomlString/WellFormattedIsReturnedAsIs
=== RUN   TestNormalizeTomlString/MalformedInputResultsInErrorAndReturnsInput
=== RUN   TestNormalizeTomlString/UnformattedInputIsFormatted
--- PASS: TestNormalizeTomlString (0.00s)
    --- PASS: TestNormalizeTomlString/WellFormattedIsReturnedAsIs (0.00s)
    --- PASS: TestNormalizeTomlString/MalformedInputResultsInErrorAndReturnsInput (0.00s)
    --- PASS: TestNormalizeTomlString/UnformattedInputIsFormatted (0.00s)
=== RUN   TestStringIsValidToml
=== RUN   TestStringIsValidToml/PassingNonStringIsAnError
=== RUN   TestStringIsValidToml/ValidTomlIsValid
=== RUN   TestStringIsValidToml/NilIsInvalid
=== RUN   TestStringIsValidToml/EmptyStringIsValid
=== RUN   TestStringIsValidToml/InvalidTomlIsInvalid
--- PASS: TestStringIsValidToml (0.00s)
    --- PASS: TestStringIsValidToml/PassingNonStringIsAnError (0.00s)
    --- PASS: TestStringIsValidToml/ValidTomlIsValid (0.00s)
    --- PASS: TestStringIsValidToml/NilIsInvalid (0.00s)
    --- PASS: TestStringIsValidToml/EmptyStringIsValid (0.00s)
    --- PASS: TestStringIsValidToml/InvalidTomlIsInvalid (0.00s)
=== CONT  TestAccCluster
Creating cluster "tf-acc-cluster-test-6067377518171609521" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-6067377518171609521-control-plane"]
Creating cluster "tf-acc-cluster-test-6067377518171609521" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-6067377518171609521-control-plane"]
Creating cluster "tf-acc-cluster-test-6067377518171609521" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after [15](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:16)s 💚
Deleted nodes: ["tf-acc-cluster-test-606737751817[16](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:17)09521-control-plane"]
Creating cluster "tf-acc-cluster-test-6067377518[17](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:18)1609521" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-cluster-test-60673775[18](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:19)1716095[21](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:22)-control-plane"]
Creating cluster "tf-acc-cluster-test-6067377518171609521" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 16s 💚
Deleted nodes: ["tf-acc-cluster-test-6067377518171609521-control-plane"]
--- PASS: TestAccCluster (216.40s)
=== CONT  TestAccClusterContainerdPatches
Creating cluster "tf-acc-containerd-test-41521[22](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:23)786[24](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:25)6734540" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 18s 💚
Deleted nodes: ["tf-acc-containerd-test-4152122786246734540-control-plane"]
--- PASS: TestAccClusterContainerdPatches (50.33s)
=== CONT  TestAccContainerdPatchFormatOnlyChangeIsNoop
Creating cluster "tf-acc-containerd-formatting-[25](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:26)78457227096674502" ...
 • Ensuring node image (kindest/node:v1.[26](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:27).3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 15s 💚
Deleted nodes: ["tf-acc-containerd-formatting-25784572[27](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:28)096674502-control-plane"]
--- PASS: TestAccContainerdPatchFormatOnlyChangeIsNoop (49.71s)
=== CONT  TestAccClusterConfigNodes
Creating cluster "tf-acc-config-nodes-test-[28](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:29)51551163621673893" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦   ...
 ✓ Preparing nodes 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-control-plane" "tf-acc-config-nodes-test-2851551163621673893-worker"]
Creating cluster "tf-acc-config-nodes-test-2851551163621673893" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦   ...
 ✓ Preparing nodes 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 0s 💚
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-control-plane" "tf-acc-config-nodes-test-2851551163621673893-worker"]
Creating cluster "tf-acc-config-nodes-test-2851551163621673893" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦   ...
 ✓ Preparing nodes 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-worker" "tf-acc-config-nodes-test-2851551163621673893-control-plane"]
Creating cluster "tf-acc-config-nodes-test-2851551163621673893" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦   ...
 ✓ Preparing nodes 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 1s 💚
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-worker" "tf-acc-config-nodes-test-2851551163621673893-control-plane"]
Creating cluster "tf-acc-config-nodes-test-2851551163621673893" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦 📦   ...
 ✓ Preparing nodes 📦 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 1s 💚
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-worker" "tf-acc-config-nodes-test-2851551163621673893-worker2" "tf-acc-config-nodes-test-2851551163621673893-control-plane"]
Creating cluster "tf-acc-config-nodes-test-2851551163621673893" ...
 • Ensuring node image (kindest/node:v1.24.6) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.24.6) 🖼
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦 📦 📦   ...
 ✓ Preparing nodes 📦 📦 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Joining worker nodes 🚜  ...
 ✓ Joining worker nodes 🚜
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 1s 💚
Deleted nodes: ["tf-acc-config-nodes-test-2851551163621673893-worker" "tf-acc-config-nodes-test-2851551163621673893-control-plane" "tf-acc-config-nodes-test-2851551163621673893-worker2"]
--- PASS: TestAccClusterConfigNodes (345.03s)
=== CONT  TestAccClusterConfigBase
Creating cluster "tf-acc-config-base-test-443973367[31](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:32)73566362" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-config-base-test-44397[33](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:34)67317[35](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:36)66[36](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:37)2-control-plane"]
Creating cluster "tf-acc-config-base-test-44[39](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:40)733673173566362" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 16s 💚
Deleted nodes: ["tf-acc-config-base-test-4[43](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:44)9733673173566362-control-plane"]
Creating cluster "tf-acc-config-base-test-[44](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:45)39733673173566362" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
Deleted nodes: ["tf-acc-config-base-test-4439733673173566362-control-plane"]
Creating cluster "tf-acc-config-base-test-4439733673173566362" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
 • Waiting ≤ 5m0s for control-plane = Ready ⏳  ...
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳
 • Ready after 16s 💚
Deleted nodes: ["tf-acc-config-base-test-4439733673173566362-control-plane"]
Creating cluster "tf-acc-config-base-test-4439733673173566362" ...
 • Ensuring node image (kindest/node:v1.26.3) 🖼  ...
 ✓ Ensuring node image (kindest/node:v1.26.3) 🖼
 • Preparing nodes 📦   ...
 ✓ Preparing nodes 📦 
 • Writing configuration 📜  ...
 ✓ Writing configuration 📜
 • Starting control-plane 🕹️  ...
 ✓ Starting control-plane 🕹️
 • Installing CNI 🔌  ...
 ✓ Installing CNI 🔌
 • Installing StorageClass 💾  ...
 ✓ Installing StorageClass 💾
    resource_cluster_test.go:103: Step 6/6 error: Error running pre-apply refresh: exit status 1
        
        Error: Invalid argument name
        
          on terraform_plugin_test.tf line 11, in resource "kind_cluster" "test":
          11: 		"api/alpha": "false"
        
        Argument names must not be quoted.
    testing_new.go:71: Error retrieving state, there may be dangling resources: exit status 1
        
        Error: Invalid argument name
        
          on terraform_plugin_test.tf line 11, in resource "kind_cluster" "test":
          11: 		"api/alpha": "false"
        
        Argument names must not be quoted.
--- FAIL: TestAccClusterConfigBase (185.74s)
FAIL
FAIL	github.com/tehcyx/terraform-provider-kind/kind	8[47](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:48).[225](https://github.com/tehcyx/terraform-provider-kind/actions/runs/4974255202/jobs/8900588114?pr=34#step:4:226)s
FAIL
√ go fmt
√ go vet ./kind/...

extra_port_mappings error

Hi,

Using this terraform script I always get an error

terraform {
required_providers {
kind = {
source = "tehcyx/kind"
version = "0.2.0"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.14.0"
}
}
}

provider "kind" {}

resource "kind_cluster" "default" {
name = "cluster-2"
node_image = "kindest/node:v1.25.3"
wait_for_ready = true

kind_config {
kind = "Cluster"
api_version = "kind.x-k8s.io/v1alpha4"

node {
  role = "control-plane"

  kubeadm_config_patches = [
    "kind: InitConfiguration\nnodeRegistration:\n  kubeletExtraArgs:\n    node-labels: \"ingress-ready=true\"\n"
  ]

  extra_port_mappings {
    container_port = 80
    host_port = 80
  }
  extra_port_mappings {
    container_port = 443
    host_port = 443
  }
}

node {
  role = "worker"      
}

node {
  role = "worker"
}

node {
  role = "worker"
}

}
}

This is terraform plan:

Terraform will perform the following actions:

kind_cluster.default will be created

  • resource "kind_cluster" "default" {
    • client_certificate = (known after apply)

    • client_key = (known after apply)

    • cluster_ca_certificate = (known after apply)

    • completed = (known after apply)

    • endpoint = (known after apply)

    • id = (known after apply)

    • kubeconfig = (known after apply)

    • kubeconfig_path = (known after apply)

    • name = "cluster-2"

    • node_image = "kindest/node:v1.25.3"

    • wait_for_ready = true

    • kind_config {

      • api_version = "kind.x-k8s.io/v1alpha4"

      • kind = "Cluster"

      • node {

        • kubeadm_config_patches = [

          • <<-EOT
            kind: InitConfiguration
            nodeRegistration:
            kubeletExtraArgs:
            node-labels: "ingress-ready=true"
            EOT,
            ]
        • role = "control-plane"

        • extra_port_mappings {

          • container_port = 80
          • host_port = 80
            }
        • extra_port_mappings {

          • container_port = 443
          • host_port = 443
            }
            }
      • node {

        • role = "worker"
          }
      • node {

        • role = "worker"
          }
      • node {

        • role = "worker"
          }
          }
          }

Plan: 1 to add, 0 to change, 0 to destroy.

and this is the error:

kind_cluster.default: Creating...

│ Error: command "docker run --name cluster-2-control-plane --hostname cluster-2-control-plane --label io.x-k8s.kind.role=control-plane --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run --volume /var --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --label io.x-k8s.kind.cluster=cluster-2 --net kind --restart=on-failure:1 --init=false --cgroupns=private --publish=0.0.0.0:80:80/TCP --publish=0.0.0.0:443:443/TCP --publish=127.0.0.1:58842:6443/TCP -e KUBECONFIG=/etc/kubernetes/admin.conf kindest/node:v1.25.3" failed with error: exit status 125

│ with kind_cluster.default,
│ on main.tf line 16, in resource "kind_cluster" "default":
│ 16: resource "kind_cluster" "default" {

Can you help?

Add support for runtimeConfig and featureGates

Kubernetes API server runtime-config can be toggled using the runtimeConfig key, which maps to the --runtime-config kube-apiserver flag. This may be used to e.g. disable beta / alpha APIs.

Wanted to turn off alpha features off from my cluster as described in Runtime Config

but getting error
% terraform plan

│ Error: Unsupported argument

│ on main.tf line 20, in resource "kind_cluster" "default":
│ 20: runtimeConfig = [

│ An argument named "runtimeConfig" is not expected here.

Seems that 'runtimeConfig' is not supported by the provider. If understood correctly 'featureGates' is not supported either. Any change we can add both as those as then this provider could be used with more advanced use cases?

kube_proxy_mode value

Hi All !
I would like the cluster not to install kube-proxy. But when kube_proxy_mode has "none" or "false", the cluster install kube-proxy.
What to be done. Thanks in advanced.

kube-system kube-proxy-2br7s 1/1 Running 0 22m
kube-system kube-proxy-85z7r 1/1 Running 0 22m
kube-system kube-proxy-bdmbq 1/1 Running 0 22m
kube-system kube-proxy-l9kwb 1/1 Running 0 22m
kube-system kube-proxy-wmk62 1/1 Running 0 22m

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.