You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues with the mirrord-config crate that make it prone to bugs or just hard to work with:
MirrordConfig macro and medschool tool are quite esoteric. It's not clear which docs end up in the markdown configuration and the json schema, markdown tags have to be manually inserted, essentially - adding more configs require copy-pasting existing stuff.
We should resolve the kubeconfig and detect the operator before verifying the config. Right now, when checking .feature section, we rely on .operator setting. We only raise "this feature requires the mirrord Operator" errors when the user explicitly disables the operator.
Config struct is too big - it contains multiple hidden entries that we only use internally. We should have a separate config struct just for the stuff that can be specified in a mirrord config file.
After config verification, we should produce something with better types and use that in the rest of the code. For example, right now the target namespace is always optional, while it doesn't have to be (same with target path). When verifying the config, we can create the kube client and resolve target namespace to target.namespace.unwrap_or(client.default_namespace()). With better types, we could also get rid of errors that should never happen, yet still happen due to bugs (KubeApiError::MissingRuntimeData).
Overall, I think we should:
Have a set of "dirty" types for client config parsed from file+env+commandline
Have a set of "clean" types to use in the rest of the code
The text was updated successfully, but these errors were encountered:
I agree. And one point I think is important - user facing configuration file docs should be generated from structs that correspond to the configuration file, not the ones we generate from that and then use internally. If we're overhauling how that works, I suggest we generate the docs from the schema file.
There are several issues with the
mirrord-config
crate that make it prone to bugs or just hard to work with:MirrordConfig
macro andmedschool
tool are quite esoteric. It's not clear which docs end up in the markdown configuration and the json schema, markdown tags have to be manually inserted, essentially - adding more configs require copy-pasting existing stuff..feature
section, we rely on.operator
setting. We only raise "this feature requires the mirrord Operator" errors when the user explicitly disables the operator.target.namespace.unwrap_or(client.default_namespace())
. With better types, we could also get rid of errors that should never happen, yet still happen due to bugs (KubeApiError::MissingRuntimeData
).Overall, I think we should:
The text was updated successfully, but these errors were encountered: