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

Fix msc old schema to have correct type #1223

Closed a-blender closed 9 months ago

a-blender commented 10 months ago

Issue: https://github.com/rancher/terraform-provider-rancher2/issues/1074

Problem

Solution

Testing

Engineering Testing

Manual Testing

Tested provisioning an RKE2 cluster on the latest version of tf rancher2 with MachineConfigSelector with config defined. Successful, new schema is used, no errors.

Tested upgrade case from 3.1.0 -> latest. State is upgraded to the correct type.

Example

Old state

"machine_selector_config": [
                  {
                    "config": {
                      "protect-kernel-default": "true"
                    },
                    "machine_label_selector": []
                  }
                ],

New state

"machine_selector_config": [
                  {
                    "config": "protect-kernel-default: \"true\"\n",
                    "machine_label_selector": []
                  }
                ],

Automated Testing

QA Testing Considerations

Regressions Considerations

HarrisonWAffel commented 10 months ago

@a-blender does this mean that prior versions of the provider which used TypeString for this field are not properly migrating? or have we not released a version where the field uses TypeString?

a-blender commented 10 months ago

@a-blender Possible, it worked fine before but I had tested the old TF version by adding MSC kubelet args via the rancher UI because this field originally was broken in the provider and wasn't passing values correctly so it didn't make logical sense to test a use case that users couldn't even use themselves. I re-tested that a migration works correctly via TF input only for this.