mirror of https://github.com/k3s-io/k3s
![]() DetectUnsupportedVersion is somewhat uncomfortable, complex and inefficient function to use. It takes an entire YAML document as bytes, splits it up to byte slices of the different YAML sub-documents and group-version-kinds and searches through those to detect an unsupported kubeadm config. If such config is detected, the function returns an error, if it is not (i.e. the normal function operation) everything done so far is discarded. This could have been acceptable, if not the fact, that in all cases that this function is called, the YAML document bytes are split up and an iteration on GVK map is performed yet again. Hence, we don't need DetectUnsupportedVersion in its current form as it's inefficient, complex and takes only YAML document bytes. This change replaces DetectUnsupportedVersion with ValidateSupportedVersion, which takes a GroupVersion argument and checks if it is on the list of unsupported config versions. In that case an error is returned. ValidateSupportedVersion relies on the caller to read and split the YAML document and then iterate on its GVK map checking if the particular GroupVersion is supported or not. Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com> |
||
---|---|---|
.. | ||
clicheck | ||
cloud-controller-manager | ||
controller-manager | ||
gendocs | ||
genkubedocs | ||
genman | ||
genswaggertypedocs | ||
genutils | ||
genyaml | ||
hyperkube | ||
importverifier | ||
kube-apiserver | ||
kube-controller-manager | ||
kube-proxy | ||
kube-scheduler | ||
kubeadm | ||
kubectl | ||
kubelet | ||
kubemark | ||
linkcheck | ||
BUILD | ||
OWNERS |