• Rostislav M. Georgiev's avatar
    kubeadm: Introduce ValidateSupportedVersion in place of DetectUnsupportedVersion · e10dcf07
    Rostislav M. Georgiev authored
    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: 's avatarRostislav M. Georgiev <rostislavg@vmware.com>
    e10dcf07
Name
Last commit
Last update
..
clicheck Loading commit data...
cloud-controller-manager Loading commit data...
controller-manager Loading commit data...
gendocs Loading commit data...
genkubedocs Loading commit data...
genman Loading commit data...
genswaggertypedocs Loading commit data...
genutils Loading commit data...
genyaml Loading commit data...
hyperkube Loading commit data...
importverifier Loading commit data...
kube-apiserver Loading commit data...
kube-controller-manager Loading commit data...
kube-proxy Loading commit data...
kube-scheduler Loading commit data...
kubeadm Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
linkcheck Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...