k3s/cmd
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
..
clicheck Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
cloud-controller-manager Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
controller-manager Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
gendocs wire config flags through factory 2018-05-04 17:02:20 -04:00
genkubedocs Update postprocessing_test.go 2019-01-30 21:22:22 +08:00
genman Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
genswaggertypedocs Move from glog to klog 2018-11-10 07:50:31 -05:00
genutils
genyaml wire config flags through factory 2018-05-04 17:02:20 -04:00
hyperkube Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
importverifier Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
kube-apiserver Merge pull request #73805 from caesarxuchao/resource-size-limit 2019-02-12 15:10:57 -08:00
kube-controller-manager Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
kube-proxy Use ioutil.TempDir for temporary dir creating 2019-02-07 12:27:19 -05:00
kube-scheduler Fix function comment to consistent with its name 2019-02-11 10:51:35 +08:00
kubeadm kubeadm: Replace MigrateOldConfigFromFile 2019-02-14 11:52:33 +02:00
kubectl Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
kubelet Merge pull request #73926 from alculquicondor/fix/kubelet-app-lint 2019-02-12 00:19:06 -08:00
kubemark Merge pull request #73854 from RajatVaryani/master 2019-02-08 22:00:24 -08:00
linkcheck
BUILD
OWNERS Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00