kubernetes/cmd
Rostislav M. Georgiev 930ca6ceb2 kubeadm: Refactor component config tests
Over the course of recent development of the `componentconfigs` package,
it became evident that most of the tests in this package cannot be implemented without
using a component config. As all of the currently supported component configs are
external to the kubeadm project (kubelet and kube-proxy), practically all of the tests
in this package are now dependent on external code.
This is not desirable, because other component's configs may change frequently and
without much of a notice. In particular many configs add new fields without bumping their
versions. In addition to that, some components may be deprecated in the future and many
tests may use their configs as a place holder of a component config just to test some
common functionality.
To top that, there are many tests that test the same common functionality several times
(for each different component config).

Thus a kubeadm managed replacement and a fake test environment are introduced.
The new test environment uses kubeadm's very own `ClusterConfiguration`.
ClusterConfiguration is normally not managed by the `componentconfigs` package.
It's only used, because of the following:
- It's a versioned API that is under the control of kubeadm maintainers. This enables us to test
  the componentconfigs package more thoroughly without having to have full and always up to date
  knowledge about the config of another component.
- Other components often introduce new fields in their configs without bumping up the config version.
  This, often times, requires that the PR that introduces such new fields to touch kubeadm test code.
  Doing so, requires more work on the part of developers and reviewers. When kubeadm moves out of k/k
  this would allow for more sporadic breaks in kubeadm tests as PRs that merge in k/k and introduce
  new fields won't be able to fix the tests in kubeadm.
- If we implement tests for all common functionality using the config of another component and it gets
  deprecated and/or we stop supporting it in production, we'll have to focus on a massive test refactoring
  or just continue importing this config just for test use.

Thus, to reduce maintenance costs without sacrificing test coverage, we introduce this mini-framework
and set of tests here which replace the normal component configs with a single one (`ClusterConfiguration`)
and test the component config independent logic of this package.

As a result of this, many of the older test cases are refactored and greatly simplified to reflect
on the new change as well. The old tests that are strictly tied to specific component configs
(like the defaulting tests) are left unchanged.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
2020-07-03 20:00:45 +03:00
..
clicheck Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-29 13:08:41 -07:00
cloud-controller-manager Run update-bazel.sh 2020-06-22 10:49:15 +09:00
controller-manager Merge pull request #90649 from cici37/leaderelectionconfig 2020-05-20 19:40:47 -07:00
gendocs
genkubedocs Drop cloud-controller-manager artifacts from k/k release 2019-08-06 13:51:27 -04:00
genman Bump github.com/cpuguy83/go-md2man dependency 2020-07-01 21:22:14 +01:00
genswaggertypedocs Run hack/update-vendor.sh 2020-05-16 07:54:33 -04:00
genutils
genyaml Remove genyaml binary 2019-04-12 08:31:29 -04:00
importverifier
kube-apiserver Promote new Event API to v1 2020-07-01 10:50:28 -04:00
kube-controller-manager Merge pull request #92655 from BenTheElder/cleanup-some-owners 2020-07-01 23:14:08 -07:00
kube-proxy Changes to WinKernel to support EndpointSlices 2020-06-29 14:31:15 -07:00
kube-scheduler Merge pull request #91522 from SataQiu/add-logging-format-flag-20200528 2020-07-02 19:04:47 -07:00
kubeadm kubeadm: Refactor component config tests 2020-07-03 20:00:45 +03:00
kubectl remove pkg/version and some of redundant copies of it 2019-09-16 16:24:35 -07:00
kubelet add dashpole and sjenning to cmd/kubelet OWNERS 2020-07-02 14:20:41 -05:00
kubemark cmd/*: fail on unrecognized flags/arguments for component CLI 2020-05-28 22:06:01 +03:00
linkcheck Invert error validation 2020-05-13 09:19:17 +01:00
preferredimports fix staticcheck faulures in 'cmd' pkg 2019-12-16 18:32:54 +08:00
verifydependencies Close the file after reading in verifydependencies#main 2019-10-19 10:46:50 -07:00
BUILD Drop cmd/hyperkube 2019-11-06 09:11:35 -05:00
OWNERS