alessiodionisi / terraform-provider-k0s

Terraform provider to create and manage k0s Kubernetes clusters, using embedded k0sctl
https://registry.terraform.io/providers/alessiodionisi/k0s
Apache License 2.0
23 stars 8 forks source link

plugin panics when the architecture is ARM64 #54

Closed akosiaris closed 1 year ago

akosiaris commented 1 year ago

Hi,

Thanks once more for this plugin.

I 've been trying out the plugin with some arm VMs and I got bitten by the following:

goroutine 385 [running]:
github.com/k0sproject/k0sctl/phase.(*PrepareArm).etcdUnsupportedArch(0xc000368280?, 0xc0006d4e00)
    github.com/k0sproject/k0sctl@v0.15.2/phase/arm_prepare.go:48 +0xce
github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster.Hosts.ParallelEach.func1(0xc0006d4e00)
    github.com/k0sproject/k0sctl@v0.15.2/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/hosts.go:115 +0xc4
created by github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster.Hosts.ParallelEach
    github.com/k0sproject/k0sctl@v0.15.2/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/hosts.go:114 +0x24e
panic: assignment to entry in nil map

Looking a bit at the code in question and trying to reproduce using the k0sctl binary as is, I am a bit at a loss. I can't reproduce it running the k0sctl, that one works fine.

The code suggests to me that what's missing is the Environment map (thus being nil) but I am not yet sure why vanilla k0sctl calls have it and the plugin doesn't.

akosiaris commented 1 year ago

For what is worth, I sidestepped this one by supplying an environment with some dummy values.

alessiodionisi commented 1 year ago

I'm working on acceptance tests to test the provider on various architectures, I hope they're useful for discovering issues like this

alessiodionisi commented 1 year ago

In the coming weeks I'll be working on an ARM cluster so I'll try to figure out how to solve this issue

alessiodionisi commented 1 year ago

Should be fixed on main branch

akosiaris commented 1 year ago

I just tested this, indeed it works fine and I no longer need the dummy environment stanzas

Thanks!

null0rUndefined commented 1 year ago

Hello @alessiodionisi . Thank you for your work. When will you be able to release a new version with this fix? The latest version is 0.2.0 which does not include this fix, as far as I can see.

alessiodionisi commented 1 year ago

@null0rUndefined released with v0.2.1: https://github.com/alessiodionisi/terraform-provider-k0s/releases/tag/v0.2.1