-
Notifications
You must be signed in to change notification settings - Fork 21
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
Server routes order #10
Comments
I had run into this as well. Thanks for reporting it. I would guess the underlying issue is that the type for routes is defined as a TypeList where is probably needs to be TypeSet, as order doesn't probably matter routing entries for a server. |
Hey @fmalykh What's version of the provider do you use? I fixed a few version ago in this commit https://github.com/disc/terraform-provider-pritunl/blob/master/internal/provider/resource_server.go#L999 The original issue is hashicorp/terraform-plugin-sdk#477 |
Hey @disc I've just imported server resources and didn't apply yet - the change looked scary for me as I thought routes may get in conflict during the |
There are two options:
|
By the way I'm going to check why the state has an incorrect order for routes after import |
Just to let you know - provider successfully renamed routes / networks and now config is in sync with state. Running plan again doesn't suggest any changes. Lovely! |
I've tried to reproduce your situation but the state file contains routes in the proper way and my terraform.tfstate file after importing the server
Can you import your server one more time and check the routes order in the "route" object of the state file? |
FWIW, I run into the ordering of routes intermittently running the test make target:
|
I've imported 7 servers and all of them showed that routes require reordering. |
No, I don't think so. |
Sure, here it is:
|
State looks properly sorted, if you have the same order in your tf-file it should be re-ordered |
Oh, you know, it seems I've reprouced the issue. Have no steps yet, but after 5-6 imports of the same server I've got a wrong order in the state file:
I will look into it |
…ting step because there is no previous (or setup in advance) state
I've found the issue and PR is ready. |
It should be fixed in next release v.0.1.2 |
Hi @disc 🙏 Here is a server config (shortened):
Here is its state:
Terraform plan shows nothing to do. Then I delete one of the routes so that .tf config looks the following:
And the plan shows something I can't explain:
|
@fmalykh Did it happen after import and just once? |
@disc hey, |
@fmalykh maybe you meant the plan looked weird, it might be because routes were re-sorted based on one deleted route, for example. It shows just in-place replacements without deleting other routes? |
Yeah, it shows in-place replacements and doesn't mention deleting the route I removed from |
Hi,
Thanks for the great provider, I've been dreaming to have it for such a long time.
After importing existing server as
pritunl_server
resource,terraform_plan
suggests multiple changes to the routes which looks like something related to routes ordering:Pritunl API returns data in the same order as stated in
pritunl_server
resource :'GET', '/server/5e45018371f6b2996983beac/route'
Is there anything to do with this? Thanks!
The text was updated successfully, but these errors were encountered: