code: func (c *testCluster) Leader() (*testNode, error) {
  	resp, err := c.api.ListNodes(context.Background(), &api.ListNodesRequest{
  		Filters: &api.ListNodesRequest_Filters{
  			Roles: []api.NodeRole{api.NodeRoleManager},
  		},
  	})
  	if err != nil {
  		return nil, err
  	}
  	for _, n := range resp.Nodes {
  		if n.ManagerStatus.Leader {
  			tn, ok := c.nodes[n.ID]
  			if !ok {
  				return nil, fmt.Errorf("leader id is %s, but it isn't found in test cluster object", n.ID)
  			}
  			return tn, nil
  		}
  	}
  	return nil, fmt.Errorf("cluster leader is not found in api response")
  }
docs: // Leader returns TestNode for cluster leader.