You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cluster_getter.go
    path of file: ./repos/pipeline/src/api/common
    
    the code of the file until where you have to start completion: // Copyright Â© 2018 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except 
    
func (g *clusterGetter) GetClusterFromRequest(c *gin.Context) (cluster.CommonCluster, bool) {
	var cl cluster.CommonCluster
	var err error

	logger := correlationid.LogrusLogger(g.logger, c)

	ctx := ginutils.Context(context.Background(), c)

	organizationID := auth.GetCurrentOrganization(c.Request).ID

	logger = logger.WithField("organization", organizationID)

	switch field := c.DefaultQuery("field", "id"); field {
	case "id":
		clusterID, ok := ginutils.UintParam(c, "id")
		if !ok {
			logger.Debug("invalid ID parameter")

			return nil, false
		}

		logger = logger.WithField("cluster", clusterID)

		cl, err = g.manager.GetClusterByID(ctx, organizationID, clusterID)
	case "name":
		clusterName := c.Param("id")

		logger = logger.WithField("cluster", clusterName)

		cl, err = g.manager.GetClusterByName(ctx, organizationID, clusterName)
	default:
		err = fmt.Errorf("field=%s is not supported", field)
	}

	if isNotFound(err) {
		logger.Debug("cluster not found")

		c.JSON(http.StatusNotFound, pkgCommon.ErrorResponse{
			Code:    http.StatusNotFound,
			Message: "cluster not found",
			Error:   err.Error(),
		})

		return nil, false
	} else if err != nil {
		g.errorHandler.Handle(err)

		c.JSON(http.StatusBadRequest, pkgCommon.ErrorResponse{
			Code:    http.StatusBadRequest,
			Message: "error parsing request",
			Error:   err.Error(),
		})

		return nil, false
	}

	return cl, true
}