mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-22 06:59:03 +00:00
Currently JoinConfigFileAndDefaultsToInternalConfig is doing a couple of different things depending on its parameters. It: - loads a versioned JoinConfiguration from an YAML file. - returns defaulted JoinConfiguration allowing for some overrides. In order to make code more manageable, the following steps are taken: - Introduce LoadJoinConfigurationFromFile, which loads a versioned JoinConfiguration from an YAML file, defaults it (both dynamically and statically), converts it to internal JoinConfiguration and validates it. - Introduce DefaultedJoinConfiguration, which returns defaulted (both dynamically and statically) and verified internal JoinConfiguration. The possibility of overwriting defaults via versioned JoinConfiguration is retained. - Re-implement JoinConfigFileAndDefaultsToInternalConfig to use LoadJoinConfigurationFromFile and DefaultedJoinConfiguration. - Replace some calls to JoinConfigFileAndDefaultsToInternalConfig with calls to either LoadJoinConfigurationFromFile or DefaultedJoinConfiguration where appropriate. - Rename JoinConfigFileAndDefaultsToInternalConfig to the more appropriate name LoadOrDefaultJoinConfiguration. Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>