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

Cannot change default revision for rancher2_cluster_template #393

Closed
caiconkhicon opened this issue Jul 22, 2020 · 5 comments
Closed

Cannot change default revision for rancher2_cluster_template #393

caiconkhicon opened this issue Jul 22, 2020 · 5 comments
Assignees

Comments

@caiconkhicon
Copy link

I have a rancher2_cluster_template resource with 2 revisions, one of them has default = true. One revision (doesn't matter which one) is used to create a managed cluster.
Now I want to swap the default revision, so I set one revision to default = false and vice versa for the other. Terraform apply fails with the error:

message=Cannot update the clusterTemplateRevision until Clusters are referring it]

No config is changed for both revisions. Meanwhile, I can change the default revision on the Rancher UI (https://rancher.com/docs/rancher/v2.x/en/admin-settings/rke-templates/creating-and-revising/#setting-a-template-revision-as-default). Thus, I think that this is not a limitation of Rancher, but a bug in the Rancher2 provider.

Please check it. Thanks a lot.

@caiconkhicon caiconkhicon changed the title Cannot set rancher2_cluster_template revision as default or not Cannot change default revision for rancher2_cluster_template Jul 22, 2020
@caiconkhicon
Copy link
Author

Another test I did is:

  • Create a template with one revision as default
  • Use the revision to create a managed cluster
  • Add a new revision and apply using Terraform
  • On Rancher UI, change the new revision to be default
  • Change Terraform code to reflect the change above (new revision is default, old one is not)
  • Apply Terraform -> Terraform wants to update the "default" value of both revisions even though in fact they are updated via Rancher UI already -> Confirm apply: fails with the same above error

@rawmind0
Copy link
Contributor

@caiconkhicon , the issue has been reproduced. Submitted PR #395 to address it

@rawmind0 rawmind0 self-assigned this Jul 26, 2020
@caiconkhicon
Copy link
Author

@rawmind0 : thanks a lot for your quick fix. I confirm that it works. I close this issue.

@abhi1693
Copy link

@rawmind0 I am facing this exact same issue with v1.10.3. In my case, I only have a single default template. I'm trying to creating a newer one with slightly different configuration changes. If I give a new name, I get Cannot update the clusterTemplateRevision until Clusters are referring it. If I do not make changes to the name, as per terraform the update is a success however there is no change on Rancher. If you need me to provide more information, let me know.

@rawmind0
Copy link
Contributor

@abhi1693 , not fully understand what are you trying to do. If you can provide the intial cluster_template definition and the updated definition, it would be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants