code: func (c *Cluster) GetSecrets(options apitypes.SecretListOptions) ([]types.Secret, error) {
  	c.mu.RLock()
  	defer c.mu.RUnlock()
  
  	state := c.currentNodeState()
  	if !state.IsActiveManager() {
  		return nil, c.errNoManager(state)
  	}
  
  	filters, err := newListSecretsFilters(options.Filters)
  	if err != nil {
  		return nil, err
  	}
  	ctx, cancel := c.getRequestContext()
  	defer cancel()
  
  	r, err := state.controlClient.ListSecrets(ctx,
  		&swarmapi.ListSecretsRequest{Filters: filters})
  	if err != nil {
  		return nil, err
  	}
  
  	secrets := make([]types.Secret, 0, len(r.Secrets))
  
  	for _, secret := range r.Secrets {
  		secrets = append(secrets, convert.SecretFromGRPC(secret))
  	}
  
  	return secrets, nil
  }
docs: // GetSecrets returns all secrets of a managed swarm cluster.