• Rostislav M. Georgiev's avatar
    kubeadm: Refactor InitConfiguration init APIs · 51197e43
    Rostislav M. Georgiev authored
    Currently ConfigFileAndDefaultsToInternalConfig and
    FetchConfigFromFileOrCluster are used to default and load InitConfiguration
    from file or cluster. These two APIs do a couple of completely separate things
    depending on how they were invoked. In the case of
    
    ConfigFileAndDefaultsToInternalConfig, an InitConfiguration could be either
    defaulted with external override parameters, or loaded from file.
    With FetchConfigFromFileOrCluster an InitConfiguration is either loaded from
    file or from the config map in the cluster.
    
    The two share both some functionality, but not enough code. They are also quite
    difficult to use and sometimes even error prone.
    
    To solve the issues, the following steps were taken:
    
    - Introduce DefaultedInitConfiguration which returns defaulted version agnostic
      InitConfiguration. The function takes InitConfiguration for overriding the
      defaults.
    
    - Introduce LoadInitConfigurationFromFile, which loads, converts, validates and
      defaults an InitConfiguration from file.
    
    - Introduce FetchInitConfigurationFromCluster that fetches InitConfiguration
      from the config map.
    
    - Reduce, when possible, the usage of ConfigFileAndDefaultsToInternalConfig by
      replacing it with DefaultedInitConfiguration or LoadInitConfigurationFromFile
      invocations.
    
    - Replace all usages of FetchConfigFromFileOrCluster with calls to
      LoadInitConfigurationFromFile or FetchInitConfigurationFromCluster.
    
    - Delete FetchConfigFromFileOrCluster as it's no longer used.
    
    - Rename ConfigFileAndDefaultsToInternalConfig to
      LoadOrDefaultInitConfiguration in order to better describe what the function
      is actually doing.
    Signed-off-by: 's avatarRostislav M. Georgiev <rostislavg@vmware.com>
    51197e43
Name
Last commit
Last update
..
clicheck Loading commit data...
cloud-controller-manager Loading commit data...
controller-manager Loading commit data...
gendocs Loading commit data...
genkubedocs Loading commit data...
genman Loading commit data...
genswaggertypedocs Loading commit data...
genutils Loading commit data...
genyaml Loading commit data...
hyperkube Loading commit data...
importverifier Loading commit data...
kube-apiserver Loading commit data...
kube-controller-manager Loading commit data...
kube-proxy Loading commit data...
kube-scheduler Loading commit data...
kubeadm Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
linkcheck Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...