func ExtractDiscoveryTokenCaCertHash(kubeadmJoinCmd string) (string, error) {
	return extractFlag(kubeadmJoinCmd, tokenDiscoveryCAHash, "discovery token CA cert hash not found")
}
ExtractDiscoveryTokenCaCertHash extracts the discover token CA cert hash
from the provided kubeadm join command.
package kubeadm
import (
	"strings"
	"github.com/pkg/errors"
	flag "github.com/spf13/pflag"
)
const (
	kubeadmJoin = "kubeadm join"
	empty       = ""
	newline     = "\n"
	whitespace  = " "
	backslash   = "\\"
	tokenDiscoveryCAHash = "discovery-token-ca-cert-hash"
	certificateKey = "certificate-key"
)
func ExtractJoinCmd(stdOut string) (string, error) {
	lines := strings.Split(stdOut, newline)
	withinCmd := false
	var cmd strings.Builder
	for _, line := range lines {
		if strings.Contains(line, kubeadmJoin) {  
			cmd.WriteString(sanitize(line))
			if hasLineContinuation(line) {
				cmd.WriteString(whitespace)
				withinCmd = true
			} else {
				break
			}
		} else if withinCmd {
			cmd.WriteString(sanitize(line))
			if hasLineContinuation(line) {
				cmd.WriteString(whitespace)
			} else {
				break
			}
		}
	}
	if cmd.Len() > 0 {
		return cmd.String(), nil
	}
	return "", errors.New("kubeadm join command not found")
}
func sanitize(line string) string {
	line = strings.TrimRight(line, backslash)  
	line = strings.TrimSpace(line)
	return line
}
func hasLineContinuation(line string) bool {
	return strings.HasSuffix(line, backslash)
}