kubernetes/cmd/kubeadm/app/util
Lubomir I. Ivanov 6cf3e36c37 kubeadm: statically default the "from cluster" InitConfiguration
During operations such as "upgrade", kubeadm fetches the
ClusterConfiguration object from the kubeadm ConfigMap.
However, due to requiring node specifics it wraps it in an
InitConfiguration object. The function responsible for that is:
  app/util/config#FetchInitConfigurationFromCluster().

A problem with this function (and sub-calls) is that it ignores
the static defaults applied from versioned types
(e.g. v1beta3/defaults.go) and only applies dynamic defaults for:
- API endpoints
- node registration
- etc...

The introduction of Init|JoinConfiguration.ImagePullPolicy now
has static defaulting of the NodeRegistration object with a default
policy of "PullIfNotPresent". Respect this defaulting by constructing
a defaulted internal InitConfiguration from
FetchInitConfigurationFromCluster() and only then apply the dynamic
defaults over it.

This fixes a bug where "kubeadm upgrade ..." fails when pulling images
due to an empty ("") ImagePullPolicy. We could assume that empty
string means default policy on runtime in:
cmd/kubeadm/app/preflight/checks.go#ImagePullCheck()

but that might actually not be the user intent during "init" and "join",
due to e.g. a typo. Similarly, we don't allow empty tokens
on runtime and error out.
2021-07-08 02:52:11 +03:00
..
apiclient re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
certs re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
config kubeadm: statically default the "from cluster" InitConfiguration 2021-07-08 02:52:11 +03:00
crypto re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
dryrun re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
etcd re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
image hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
initsystem hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
kubeconfig hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
output re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
patches re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
pkiutil re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
pubkeypin kubeadm: fix the bug that kubeadm only uses the first hash in caCertHashes to verify the root CA 2021-05-13 19:38:39 +08:00
runtime re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
staticpod re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
users re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
arguments_test.go kubeadm: use T.Run API in app/util 2018-12-29 18:27:38 +02:00
arguments.go Use fmt.printf() to end with a newline 2019-04-10 03:27:25 -04:00
chroot_unix.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
chroot_windows.go [kubeadm/app/]switch to github.com/pkg/errors 2018-10-30 16:23:24 +08:00
copy.go Adding etcd upgrade to kubeadm upgrade apply 2017-11-18 18:47:50 -05:00
endpoint_test.go kubeadm cleanup: master -> control-plane (cont.3) 2019-02-23 10:19:26 +07:00
endpoint.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
env.go propagate proxy env var to kube-proxy 2019-10-30 16:18:43 +01:00
error_test.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
error.go kubeadm: use git.k8s.io link in app/util/error.go 2021-05-17 19:54:08 +03:00
marshal_test.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
marshal.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00
net_test.go Fix Test for kubeadm/app/util/net.GetHostname 2019-08-19 14:38:19 +02:00
net.go kubeadm: get rid of dependency on pkg/util/node 2019-07-17 18:49:39 +03:00
template_test.go Update pause image to v3.5 2021-05-25 09:04:46 +02:00
template.go [kubeadm/app/util]switch to github.com/pkg/errors 2018-10-26 15:17:21 +08:00
version_test.go kubeadm: drop explicit constant override in version test 2021-02-06 11:03:00 -06:00
version.go re-order the imports in kubeadm 2021-07-04 16:41:27 +08:00