code: func (c *Cluster) CreateConfig(s types.ConfigSpec) (string, error) {
  	var resp *swarmapi.CreateConfigResponse
  	if err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
  		configSpec := convert.ConfigSpecToGRPC(s)
  
  		r, err := state.controlClient.CreateConfig(ctx,
  			&swarmapi.CreateConfigRequest{Spec: &configSpec})
  		if err != nil {
  			return err
  		}
  		resp = r
  		return nil
  	}); err != nil {
  		return "", err
  	}
  	return resp.Config.ID, nil
  }
docs: // CreateConfig creates a new config in a managed swarm cluster.