• Rostislav M. Georgiev's avatar
    kubeadm: Detect CRIs automatically · f97770b1
    Rostislav M. Georgiev authored
    In order to allow for a smoother UX with CRIs different than Docker, we have to
    make the --cri-socket command line flag optional when just one CRI is
    installed.
    
    This change does that by doing the following:
    
    - Introduce a new runtime function (DetectCRISocket) that will attempt to
      detect a CRI socket, or return an appropriate error.
    - Default to using the above function if --cri-socket is not specified and
      CRISocket in NodeRegistrationOptions is empty.
    - Stop static defaulting to DefaultCRISocket. And rename it to
      DefaultDockerCRISocket. Its use is now narrowed to "Docker or not"
      distinguishment and tests.
    - Introduce AddCRISocketFlag function that adds --cri-socket flag to a flagSet.
      Use that in all commands, that support --cri-socket.
    - Remove the deprecated --cri-socket-path flag from kubeadm config images pull
      and deprecate --cri-socket in kubeadm upgrade apply.
    Signed-off-by: 's avatarRostislav M. Georgiev <rostislavg@vmware.com>
    f97770b1