rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 219 forks source link

[BUG] Unable to provision clusters in OpenStack after keypair_name was removed #1233

Closed klippo closed 9 months ago

klippo commented 9 months ago

Rancher Server Setup

Information about the Cluster

User Information

N/A

Provider Information

Describe the bug

The keypair_name config was removed in https://github.com/rancher/terraform-provider-rancher2/pull/942 and https://github.com/rancher/terraform-provider-rancher2/pull/1227 and while this might be valid for AWS it breaks OpenStack functionality.

I've tested this on OpenStack Yoga with provider version 3.2.0-rc2 and instances fails to spawn with the following error message

  failureMessage: >-
    Failure detected from referenced resource rke-machine.cattle.io/v1,
    Kind=OpenstackMachine with name
    "cluster-b0678758-brgrl": Trying to access
    option  which does not exist

    THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR

    Type assertion did not go smoothly to string for key 

    [cmdCreateInner] error setting machine configuration from flags provided:
    Both KeyPairName and PrivateKeyFile must be specified

Unless I'm missing something this change for OpenStack should be reverted

I initially commented in https://github.com/rancher/terraform-provider-rancher2/issues/1192, but decided to create a separate bug report

To Reproduce

Provision a Kubernetes cluster in OpenStack without specifying keypair_name

Actual Result

Unable to create instances

Expected Result

Instances are created