-
Notifications
You must be signed in to change notification settings - Fork 53
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
NotFoundError when update returns no data objects #52
Comments
Documents of our observations are a great idea but sadly I haven't done that yet. I think in this case, since its already a named error, the best bet is to probably just account for this on the provider side, do an |
To be clear, both of these conditions currently result in
The controller's behavior appears to be different in these two cases:
Are you saying you prefer the second case to continue to return |
I ran into this a while ago on the Device resource, and in that case I was able to track it down to the The solution for that specific case was to remove |
When calling
UpdateNetwork
, I occasionally get a response containing no data elements:This results in a
&NotFoundError{}
being returned at https://github.com/paultyng/go-unifi/blob/main/unifi/network.generated.go#L392.I suspect what's happening is that my change ends up being a no-op change from the controller's perspective, so it returns an empty
data
element. In Terraform land, this results in myapply
failing even though it did actually apply "correctly". What should happen here? The implied behavior of the update methods seems to be to return a new copy of the object passed, presumably with any added fields from the controller populated or changed. But it doesn't seem like we can actually rely on that behavior. Should the function return an empty&Network{}
instance in this case?nil
?Is there any documentation collecting a description of apparent behavior and assumptions like this?
This is potentially one of many bugs/changes I might want to start hacking on. Is the right thing to do to start opening individual issues, pull requests, or do you have a preference for accepting contributions?
The text was updated successfully, but these errors were encountered: