k3s/cmd/kubeadm/app
Rostislav M. Georgiev f73ac0da3e kubeadm: Replace MigrateOldConfigFromFile
MigrateOldConfigFromFile is a function, whose purpose is to migrate one config
into another. It is working OK for now, but it has some issues:

- It is incredibly inefficient. It can reload and re-parse a single config file
  for up to 3 times.

- Because of the reloads, it has to take a file containing the configuration
  (not a byte slice as most of the rest config functions). However, it returns
  the migrated config in a byte slice (rather asymmetric from the input
  method).

- Due to the above points it's difficult to implement a proper interface for
  deprecated kubeadm config versions.

To fix the issues of MigrateOldConfigFromFile, the following is done:

- Re-implement the function by removing the calls to file loading package
  public APIs and replacing them with newly extracted package private APIs that
  do the job with pre-provided input data in the form of
  map[GroupVersionKind][]byte.

- Take a byte slice of the input configuration as an argument. This makes the
  function input symmetric to its output. Also, it's now renamed to
  MigrateOldConfig to represent the change from config file path as an input
  to byte slice.

- As a bonus (actually forgotten from a previous change) BytesToInternalConfig
  is renamed to the more descriptive BytesToInitConfiguration.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2019-02-14 11:52:33 +02:00
..
apis/kubeadm kubeadm: Detect CRIs automatically 2019-01-21 16:12:04 +02:00
cmd kubeadm: Replace MigrateOldConfigFromFile 2019-02-14 11:52:33 +02:00
componentconfigs kubeadm: use T.Run API in app/ 2019-01-02 17:14:02 +02:00
constants Bump CoreDNS version to 1.3.1 2019-01-31 16:55:02 -05:00
discovery error-imports-cleanups 2019-01-03 13:25:18 +01:00
features kubeadm: use T.Run API in app/ 2019-01-02 17:14:02 +02:00
images kubeadm: set pod-infra-container-image for the kubelet 2018-11-13 13:10:22 -05:00
phases kubeadm: Replace MigrateOldConfigFromFile 2019-02-14 11:52:33 +02:00
preflight autogenerated bazel 2019-02-08 19:31:22 +02:00
util kubeadm: Replace MigrateOldConfigFromFile 2019-02-14 11:52:33 +02:00
BUILD kubeadm: graduate mark-control-plane phase 2018-11-11 04:56:55 +02:00
kubeadm.go Move from glog to klog 2018-11-10 07:50:31 -05:00