• Lubomir I. Ivanov's avatar
    kubeadm/phases: use common interfaces for init and join phases · de5e17e6
    Lubomir I. Ivanov authored
    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.
    de5e17e6
data.go 1.3 KB