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: utils.go
    path of file: ./repos/erda/internal/tools/orchestrator/scheduler/executor/plugins/k8s/addon
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may 
    
func SetAddonLabelsAndAnnotations(service apistructs.Service, labels, annotations map[string]string) {
	for lk, lv := range service.Labels {
		if strings.HasPrefix(lk, LabelKeyPrefix) {
			annotations[strings.TrimPrefix(lk, LabelKeyPrefix)] = lv
			continue
		} else {
			if errs := validation.IsValidLabelValue(lv); len(errs) > 0 {
				logrus.Warnf("Label key: %s with invalid value: %s will not convert to kubernetes label.", lk, lv)
				continue
			}
			labels[lk] = lv
			if lk == apistructs.AlibabaECILabel && lv == "true" {
				images := strings.Split(service.Image, "/")
				if len(images) >= 2 {
					annotations[diceyml.AddonImageRegistry] = images[0]
				}
			}
		}
	}

	for lk, lv := range service.DeploymentLabels {
		if strings.HasPrefix(lk, LabelKeyPrefix) {
			annotations[strings.TrimPrefix(lk, LabelKeyPrefix)] = lv
		} else {
			labels[lk] = lv
			if lk == apistructs.AlibabaECILabel && lv == "true" {
				images := strings.Split(service.Image, "/")
				if len(images) >= 2 {
					annotations[diceyml.AddonImageRegistry] = images[0]
				}
			}
		}
	}
}