// DetectUnsupportedVersion reads YAML bytes, extracts the TypeMeta information and errors out with an user-friendly message if the API spec is too old for this kubeadm version
// TODO: On our way to making the kubeadm API beta and higher, give good user output in case they use an old config file with a new kubeadm version, and
// tell them how to upgrade. The support matrix will look something like this now and in the future:
// ValidateSupportedVersion checks if a supplied GroupVersion is not on the list of unsupported GVs. If it is, an error is returned.
returnerrors.Errorf("your configuration file uses an old API spec: %q. Please use kubeadm %s instead and run 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.",gvk.GroupVersion().String(),useKubeadmVersion)
}
knownKinds[gvk.Kind]=true
}
// InitConfiguration and JoinConfiguration may not apply together, warn if more than one is specified
returnerrors.Errorf("your configuration file uses an old API spec: %q. Please use kubeadm %s instead and run 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.",gv.String(),useKubeadmVersion)
}
ifmutuallyExclusiveCount>1{
klog.Warningf("WARNING: Detected resource kinds that may not apply: %v",mutuallyExclusive)