Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hcloud-k3s doesnt work with v3.3.0 #127

Closed
fperk opened this issue May 17, 2023 · 1 comment · Fixed by #128
Closed

hcloud-k3s doesnt work with v3.3.0 #127

fperk opened this issue May 17, 2023 · 1 comment · Fixed by #128
Assignees
Labels
kind/bug Something isn't working

Comments

@fperk
Copy link

fperk commented May 17, 2023

When i try to run the the terraform plan i get the following error:

╷
│ Warning: Redundant empty provider block
│
│   on .terraform/modules/k3s_example_hcloud-k3s/examples/hcloud-k3s/main.tf line 1:
│    1: provider "hcloud" {}
│
│ Earlier versions of Terraform used empty provider blocks ("proxy provider configurations") for child modules to declare their need to be passed a provider configuration by their
│ callers. That approach was ambiguous and is now deprecated.
│
│ If you control this module, you can migrate to the new declaration syntax by removing all of the empty provider "hcloud" blocks and then adding or updating an entry like the
│ following to the required_providers block of module.k3s_example_hcloud-k3s:
│     hcloud = {
│       source = "hetznercloud/hcloud"
│     }
╵
╷
│ Error: Iteration over null value
│
│   on .terraform/modules/k3s_example_hcloud-k3s/server_nodes.tf line 12, in locals:
│   12:   install_env_vars = join(" ", [for k, v in var.k3s_install_env_vars : "${k}=${v}"])
│     ├────────────────
│     │ var.k3s_install_env_vars is null
│
│ A null value cannot be used as the collection in a 'for' expression.
╵

The Warning can be fixed when we remove the provider block from the main.tf in hcloud-k3s:

provider "hcloud" {}

And the Error can be fixed when we add this check to the variable in the server_nodes.tf in the main module:

install_env_vars = var.k3s_install_env_vars == null ? "" : join(" ", [for k, v in var.k3s_install_env_vars : "${k}=${v}"])
@xunleii
Copy link
Owner

xunleii commented May 17, 2023

Hi @fperk, thanks for your feedback, I will make a quick fix right now.

@xunleii xunleii added the kind/bug Something isn't working label May 17, 2023
@xunleii xunleii self-assigned this May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants