fix: recreation of kubeconfig fails after migration (#928)

This commit is contained in:
Marcel Jacek 2025-07-25 11:34:17 +02:00 committed by GitHub
parent 229930ee0c
commit 33b239a74d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -276,6 +276,8 @@ func (r *kubeconfigResource) Read(ctx context.Context, req resource.ReadRequest,
clusterName := model.ClusterName.ValueString()
kubeconfigUUID := model.KubeconfigId.ValueString()
region := r.providerData.GetRegionWithOverride(model.Region)
// Prevent error state when updating to v2 api version and the kubeconfig is expired
model.Region = types.StringValue(region)
// Prevent recreation of kubeconfig when updating to v2 api version
diags = resp.State.SetAttribute(ctx, path.Root("region"), region)
resp.Diagnostics.Append(diags...)