mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-21 22:49:31 +00:00
The custom sub-set interfaces in init/join phases as a pattern have isolation benefits - e.g. when a consumer imports these but we don't want them to be able to call all methods from the original object that satisfies a complete interface. On the other hand these sub-set interfaces under phases/init and phases/join are private. Expose a couple of new common interfaces: - InitData from phases/init/data.go - JoinData from phases/join/data.go Use these interfaces in init/join phases accordingly instead of the sub-set interfaces. Use compile-time type assertion to verify that these interfaces can be satisfied by init.go's initData and join.go's joinData. Add NO-OP objects called testInitData and joinInitData that can be used for unit testing if embedded.