Closed jakefhyde closed 1 year ago
Reproduced w/ rancher2 TFP v3.0.1
:
v3.0.1
and the main.tf
file provided below, run terraform apply
and observe the default value assigned to digitalocean_config > userdata
:
terraform {
required_providers {
rancher2 = {
source = "rancher/rancher2"
version = "3.0.1"
}
}
}
provider "rancher2" {
api_url = "
resource "rancher2_cloud_credential" "rancher2_cloud_credential" {
name = "tf-do"
digitalocean_credential_config {
access_token = "
resource "rancher2_machine_config_v2" "rancher2_machine_config_v2" {
generate_name = "terratest"
digitalocean_config {
access_token = "
resource "rancher2_cluster_v2" "rancher2_cluster_v2" { name = "jkeslar3my2" kubernetes_version = "v1.26.5+rke2r1" enable_network_policy = false default_cluster_role_for_project_members = "user" rke_config { machine_pools { name = "pool1" cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id control_plane_role = false etcd_role = true worker_role = false quantity = 1 machine_config { kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind name = rancher2_machine_config_v2.rancher2_machine_config_v2.name } } machine_pools { name = "pool2" cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id control_plane_role = true etcd_role = false worker_role = false quantity = 1 machine_config { kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind name = rancher2_machine_config_v2.rancher2_machine_config_v2.name } } machine_pools { name = "pool3" cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id control_plane_role = false etcd_role = false worker_role = true quantity = 1 machine_config { kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind name = rancher2_machine_config_v2.rancher2_machine_config_v2.name } } } }
2. Reproduced - value defaults to `docker-user`
Screenshot:
![Screenshot 2023-06-14 at 2 41 41 PM](https://github.com/rancher/terraform-provider-rancher2/assets/46494969/9c253e0e-298d-45fa-a94d-1a3e83f41270)
---
Verified (locally) with rancher2 TFP `v3.1.0-rc1`:
1. Using (local) rancher2 provider `v3.1.0-rc1` and the `main.tf` file provided below, run `terraform apply` and observe the default value assigned to `digitalocean_config > userdata`:
```terraform
terraform {
required_providers {
rancher2 = {
source = "terraform.local/local/rancher2"
version = "3.1.0-rc1"
}
}
}
provider "rancher2" {
api_url = "<REDACTED>"
token_key = "<REDACTED>"
insecure = true
}
resource "rancher2_cloud_credential" "rancher2_cloud_credential" {
name = "tf-do"
digitalocean_credential_config {
access_token = "<REDACTED>"
}
}
resource "rancher2_machine_config_v2" "rancher2_machine_config_v2" {
generate_name = "terratest"
digitalocean_config {
access_token = "<REDACTED>"
}
}
resource "rancher2_cluster_v2" "rancher2_cluster_v2" {
name = "jkeslar3my2"
kubernetes_version = "v1.26.5+rke2r1"
enable_network_policy = false
default_cluster_role_for_project_members = "user"
rke_config {
machine_pools {
name = "pool1"
cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
control_plane_role = false
etcd_role = true
worker_role = false
quantity = 1
machine_config {
kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
}
}
machine_pools {
name = "pool2"
cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
control_plane_role = true
etcd_role = false
worker_role = false
quantity = 1
machine_config {
kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
}
}
machine_pools {
name = "pool3"
cloud_credential_secret_name = rancher2_cloud_credential.rancher2_cloud_credential.id
control_plane_role = false
etcd_role = false
worker_role = true
quantity = 1
machine_config {
kind = rancher2_machine_config_v2.rancher2_machine_config_v2.kind
name = rancher2_machine_config_v2.rancher2_machine_config_v2.name
}
}
}
}
2 Verified - no value assigned; as expected
Screenshot:
Describe the bug
For some reason, the default userdata is populated as
docker-user
, when it should be empty. This prevent users from provisioning DO downstream clusters without specifying an empty userdata.To Reproduce
Try to provision DO node drive downstream rke2 cluster
Actual Result
machine pods crash loop with following logs:
Expected Result
No crashlooping machine pods
Screenshots
Additional context