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: activity_deploy_cluster_autoscaler.go
    path of file: ./repos/pipeline/internal/cluster/clustersetup/autoscaler
    
    the code of the file until where you have to start completion: // Copyright Â© 2021 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package autoscaler

import (
	"context"
	"fmt"

	"emperror.dev/errors"
	"github.com/Masterminds/semver/v3"
	"github.com/ghodss/yaml"
	"go.uber.org/cadence/activity"
	"go.uber.org/zap"
	meta_v1 "k8s.io/apimachinery/pkg/ap
    
func getImageVersion(logger *zap.SugaredLogger, cluster interface{}) map[string]string {
	var selectedImageVersion map[string]string

	k8sVersion, err := getK8sVersion(cluster)
	if err != nil {
		logger.Error(errors.WrapIf(err, "unable to retrieve K8s version of cluster"))
	} else {
		for _, imageVersion := range global.Config.Cluster.Autoscale.Charts.ClusterAutoscaler.ImageVersionConstraints {
			constraint, err := semver.NewConstraint(imageVersion.K8sVersion)
			if err != nil {
				logger.Error(errors.WrapIf(err, fmt.Sprintf("invalid version constraint specified in config: %s", imageVersion.K8sVersion)))
			} else if constraint.Check(k8sVersion) {
				selectedImageVersion = map[string]string{
					"repository": imageVersion.Repository,
					"tag":        imageVersion.Tag,
				}
				break
			}
		}
	}

	// if no image found for k8s major.minor version choose the latest
	if selectedImageVersion == nil {
		l := len(global.Config.Cluster.Autoscale.Charts.ClusterAutoscaler.ImageVersionConstraints)
		imageVersion := global.Config.Cluster.Autoscale.Charts.ClusterAutoscaler.ImageVersionConstraints[l-1]
		logger.Debugf("no matching image found for cluster, using the latest version: %s", imageVersion.Repository)
		selectedImageVersion = map[string]string{
			"repository": imageVersion.Repository,
			"tag":        imageVersion.Tag,
		}
	}

	return selectedImageVersion
}