-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Currently remote components embed both: CommonSpec and InstanceSpec
https://github.com/ytsaurus/ytsaurus-k8s-operator/blob/main/api/v1/remoteexecnodes_types.go#L27-L28
and they have intersection in json field names (hostNetwork, nativeTransport) — that leads to conflicts/shadowing:
- in case we serialize struct with 2 values being set — last one wins (I think)
- in case we deserialize struct: value will be set for both embedded fields
We actually would have the compilation-level error if we embed InstanceSpec near to the CommonSpec, but since we embed indirectly (https://github.com/ytsaurus/ytsaurus-k8s-operator/blob/main/api/v1/remoteexecnodes_types.go#L28) — we somehow avoid this compillation error and mask it.
We need to think about this defaults/overrides and if we can change the code, so we don't embed both structures, because it smells bad design.
At least, it is not make sense to have common hostNetwork and component specific host-network (and any defaults) when we are talking about single component, so probably structures should be less granular here.
This issue should be a part of "Splitting CRD" epic.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status