-
Notifications
You must be signed in to change notification settings - Fork 376
keycloak_openid_client remove merge with existing config on import #1008
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
base: main
Are you sure you want to change the base?
Conversation
|
Not obvious by the error messages why the acceptance tests failed - some help would be greatly appreciated :) |
|
any chance this can get into next release? |
|
Oh dear... |
c60f5bd to
90bab85
Compare
Signed-off-by: Chris Milson-Tokunaga <[email protected]>
Signed-off-by: Chris Milson-Tokunaga <[email protected]>
|
@chrismilson Have you tried running the tests locally? |
|
@sschu I have not been able to do that - I have had trouble setting up the development environment locally I should be able to run tests locally over the weekend though. |
Signed-off-by: Chris Milson-Tokunaga <[email protected]>
|
I was able to run tests locally. Had a little difficulty setting up the environment, but I'll put that info in a separate issue. Should be ready for review, now @sschu. Thank you for your patience! |
|
@sschu anything else I should do before merge? |
|
@chrismilson Sorry for the delay. I would still like to reproduce this first and also look at how this is done for other resources. I need a bit more time since I have some pressing issues on my plate currently. |
|
No worries :) take your time I'm also happy to allocate some time to this keycloak terraform project - let me know if there's anything I can do |
|
@chrismilson So I finally had time to look at this issue, sorry it took so long. I can reproduce it and I think you analysis of whats going on is correct. What is still puzzling me is why would you use the existing configuration of the client at all when updating it? What you really want after import is to have the configuration you declared and default values for anything you haven't declared. But I am afraid I might be missing something here. The thing is, the merge also exists for @mrparkers Do you happen to remember why you did it that way? |
|
@sschu If I recall correctly, the original problem we were trying to solve with the At the time, I made the decision that this functionality should be very similar to how Whether or not it should work this way is probably still a subject for debate. The obvious downside to this decision is an initial |
|
@mrparkers Thanks for elaborating, seems like you have a good memory! ;) I understand the intention now which is to prevent doing any changes to the existing configuration without being alerted of this. Need to think about this a little more... |
|
Sounds like there are two apparently conflicting requirements:
The original implementation fails on the first point, but this PR's implementation currently fails on the second point. Perhaps a good starting place would be some unit tests to model both of these situations. I'll take that as an action. I have a couple of ideas for how we might be able to implement something that could satisfy both conditions, but would need to do a bit more exploration first. |
|
Is there a better name to use than "import" if the expectation is that it is only intended to be used on resources created implicitly? (but that should also be tracked by terraform) The existing If we treat it that way, then the onus to satisfy the second requirement - explicitly show changes from pre-existing values, because that is how a |
|
@chrismilson I was thinking in similar directions, like would it be possible to already show a diff on the original apply when Terraform says a resource would be created. But I could imagine that's not possible since resource creating normally looks different. I also agree on the naming of the parameter, but I would probably not change it this time since it's a breaking change. |
|
I'm pretty sure we wont be able to come up with something that always shows the difference on the first plan, just because in some situations, the resource to be imported will only exist at apply time. (e.g. account-console client if the plan includes the creation of the realm as well) If you limit your scope to situations when the resource to import does exist at the first plan, the What if we deprecate import, create a newly named boolean field, and until the next major release both fields have the same effect, you just get a warning if you use "import" to switch to the new naming. Let me know if I'm being way too gung-ho on the whole naming thing too. In theory we just need to update the documentation for the field if we decide what the provider's opinions are about its intended use. |
Fixes #1007