Add spicedb_relationship to manage relationships#4
Add spicedb_relationship to manage relationships#4frekw wants to merge 5 commits intoEducationPerfect:mainfrom
spicedb_relationship to manage relationships#4Conversation
This should make it possible to bootstrap things like initial roles and other things that should always exist in SpiceDB.
c1c2e43 to
ee0442f
Compare
| resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) | ||
| } | ||
|
|
||
| func (r *RelationshipResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { |
There was a problem hiding this comment.
I am not sure if having Update not implemented would work?
Is it possible that in case of a change TF would think that SpiceDB was updated (because function returns) while no actual changes are performed?
There was a problem hiding this comment.
I think that's fine, from the documentation on Update:
An error is returned if the response state is not set when Update is called by the framework. If the resource does not support modification and should always be recreated on configuration value updates, the Update logic can be left empty and ensure all configurable schema attributes implement the resource.RequiresReplace() attribute plan modifier.
|
thanks @frekw! As for tests, there is this trick in TF that allows it to use a local version of a provider instead of the "real" one from the repository: you create a local In fact, the CI does this as a step: https://github.com/EducationPerfect/terraform-provider-spicedb/blob/main/.github/workflows/test.yml#L76 Could you please try it and see if you can make tests to pass? |
|
Ah great! I'll try that to ensure I can get the tests working. Thanks for the pointer! 🙇 |
|
@AlexeyRaga I got everything to work based on your pointers (locally at least) :) |
|
Ping @AlexeyRaga any updates? :) |
|
Ping @AlexeyRaga |
This should make it possible to bootstrap things like initial roles and other things that should always exist in SpiceDB.
This is my first attempt at writing a TF provider, so happy to receive feedback. I was also unable to run the tests locally due to
so would gladly receive pointers to get them to run!
I took the liberty to pull in a
spicedbas a dependency (a slightly older version compatible with go 1.19) in order to make sure we parse the actual relationships in the exact same way as it andzeddoes. I realize that dependency is a bit on the heavier side so happy to do something simpler if you prefer.