code: func (m *Stub) Register(kubeletEndpoint, resourceName string, pluginSockDir string) error {
  	if pluginSockDir != "" {
  		if _, err := os.Stat(pluginSockDir + "DEPRECATION"); err == nil {
  			log.Println("Deprecation file found. Skip registration.")
  			return nil
  		}
  	}
  	log.Println("Deprecation file not found. Invoke registration")
  	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
  	defer cancel()
  
  	conn, err := grpc.DialContext(ctx, kubeletEndpoint, grpc.WithInsecure(), grpc.WithBlock(),
  		grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
  			return net.DialTimeout("unix", addr, timeout)
  		}))
  	if err != nil {
  		return err
  	}
  	defer conn.Close()
  	client := pluginapi.NewRegistrationClient(conn)
  	reqt := &pluginapi.RegisterRequest{
  		Version:      pluginapi.Version,
  		Endpoint:     path.Base(m.socket),
  		ResourceName: resourceName,
  		Options:      &pluginapi.DevicePluginOptions{PreStartRequired: m.preStartContainerFlag},
  	}
  
  	_, err = client.Register(context.Background(), reqt)
  	if err != nil {
  		return err
  	}
  	return nil
  }
docs: // Register registers the device plugin for the given resourceName with Kubelet.