code: func makeLeaderElectionConfig(config kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration, client clientset.Interface, recorder record.EventRecorder) (*leaderelection.LeaderElectionConfig, error) {
  	hostname, err := os.Hostname()
  	if err != nil {
  		return nil, fmt.Errorf("unable to get hostname: %v", err)
  	}
  	// add a uniquifier so that two processes on the same host don't accidentally both become active
  	id := hostname + "_" + string(uuid.NewUUID())
  
  	rl, err := resourcelock.New(config.ResourceLock,
  		config.LockObjectNamespace,
  		config.LockObjectName,
  		client.CoreV1(),
  		client.CoordinationV1(),
  		resourcelock.ResourceLockConfig{
  			Identity:      id,
  			EventRecorder: recorder,
  		})
  	if err != nil {
  		return nil, fmt.Errorf("couldn't create resource lock: %v", err)
  	}
  
  	return &leaderelection.LeaderElectionConfig{
  		Lock:          rl,
  		LeaseDuration: config.LeaseDuration.Duration,
  		RenewDeadline: config.RenewDeadline.Duration,
  		RetryPeriod:   config.RetryPeriod.Duration,
  		WatchDog:      leaderelection.NewLeaderHealthzAdaptor(time.Second * 20),
  		Name:          "kube-scheduler",
  	}, nil
  }
docs: // makeLeaderElectionConfig builds a leader election configuration. It will
  // create a new resource lock associated with the configuration.