We were only passing in the LuCI JSON-RPC client because that's all we
thought we needed. What we found out recently is that we have been using
the Metadata method incorrectly, and we need to change how we're doing
Data Source and Resource initialization.
As it turns out, the Metadata method seems to discard the Data Source
or Resource it's called on. So us setting the fullTypeName in the
Metadata method was doing nothing, and out logs were missing
information.
To rectify this, we're going to set the fullTypeName in the
Configure method. This should stay on the state of the Data Source and
Resource for the lifecycle that we care about. It seems odd that we have
to make both of these methods in the first place. But the fact that we
have to be aware that one of them is effectively a function and not a
method (Metadata) is pretty confusing. Hopefully the framework makes
this a little easier to deal with in the future.
We were only passing in the LuCI JSON-RPC client because that's all we thought we needed. What we found out recently is that we have been using the
Metadata
method incorrectly, and we need to change how we're doing Data Source and Resource initialization.As it turns out, the
Metadata
method seems to discard the Data Source or Resource it's called on. So us setting thefullTypeName
in theMetadata
method was doing nothing, and out logs were missing information.To rectify this, we're going to set the
fullTypeName
in theConfigure
method. This should stay on the state of the Data Source and Resource for the lifecycle that we care about. It seems odd that we have to make both of these methods in the first place. But the fact that we have to be aware that one of them is effectively a function and not a method (Metadata
) is pretty confusing. Hopefully the framework makes this a little easier to deal with in the future.