func PrefixTaskId(taskId string, session string) string {
	if strings.HasPrefix(session, taskId) {
		return session
	}
	return taskId + "_" + session
}
Add taskId as prefix
package file
import (
	"bufio"
	"bytes"
	"container/list"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"regexp"
	"strings"
	mesos "github.com/mesos/mesos-go/mesosproto"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"gopkg.in/yaml.v2"
	"github.com/paypal/dce-go/config"
	"github.com/paypal/dce-go/types"
	"github.com/paypal/dce-go/utils/pod"
)
const (
	FILE_DELIMITER = ","
	YAML_SEPARATOR = "#---#"
	FILE_POSTFIX   = "-generated.yml"
	PATH_DELIMITER = "/"
	MAP_DELIMITER  = "="
	TraceFolder    = "composetrace"
)
type EditorFunc func(serviceName string, taskInfo *mesos.TaskInfo, executorId string, taskId string, containerDetails map[interface{}]interface{}, ports *list.Element) (map[interface{}]interface{}, *list.Element, error)
func GetFiles(taskInfo *mesos.TaskInfo) ([]string, error) {
	log.Println("====================Retrieve  compose file list from fileName label====================")
	filelist := pod.GetLabel("fileName", taskInfo)
	if filelist == "" {
		err := errors.New("missing label fileName")
		log.Errorln(err)
		return nil, err
	}
	var files []string
	for _, file := range strings.Split(filelist, FILE_DELIMITER) {
		files = append(files, strings.TrimSpace(file))
	}
	log.Println("Required file list : ", files)
	return files, nil
}
func GetPluginOrder(taskInfo *mesos.TaskInfo) ([]string, error) {
	log.Println("====================Get plugin order====================")
	pluginList := pod.GetLabel(types.PLUGIN_ORDER, taskInfo)
	if pluginList == "" {
		err := errors.New("Missing label pluginorder")
		return nil, err
	}
	var plugins []string
	for _, plugin := range strings.Split(pluginList, FILE_DELIMITER) {
		plugins = append(plugins, plugin)
	}
	pod.PluginOrder = plugins
	log.Println("Plugin Order : ", pod.PluginOrder)
	return plugins, nil
}
func GetYAML(taskInfo *mesos.TaskInfo) []string {
	log.Println("====================Get compose file from URI====================")
	var files []string
	if taskInfo == nil || taskInfo.Executor == nil || taskInfo.Executor.Command == nil {
		return files
	}
	uris := taskInfo.Executor.Command.GetUris()
	for _, uri := range uris {
		arr := strings.Split(uri.GetValue(), "/")
		name := arr[len(arr)-1]
		GetDirFilesRecv(name, &files)
	}
	log.Println("Compose file from URI: ", files)
	return files
}
func GetDirFilesRecv(dir string, files *[]string) {
	d, err := os.Stat(dir)
	if err != nil {
		log.Errorf("Error getting file info of %s:%v\n", dir, err)
		return
	}
	if !d.IsDir() && (strings.HasSuffix(dir, ".yml") || strings.HasSuffix(dir, ".yaml") || dir == "yaml") {
		*files = append(*files, dir)
		return
	}
	archiveExt := []string{".tar", ".tar.gz", ".tar.bz2", ".tar.xz", ".gz", ".tgz", ".tbz2", ".txz", ".zip"}
	fileext := filepath.Ext(dir)
	if index := IndexArray(archiveExt, fileext); index != -1 {
		dir = strings.TrimSuffix(dir, fileext)
	}
	dirs, err := ioutil.ReadDir(dir)
	if err != nil || dirs == nil || len(dirs) == 0 {
		log.Printf("%s is not a directory : %v", dir, err)
		return
	}
	for _, f := range dirs {
		if !f.IsDir() {
			if strings.Contains(f.Name(), ".yml") {
				*files = append(*files, dir+"/"+f.Name())
			}
		} else {
			GetDirFilesRecv(dir+"/"+f.Name(), files)
		}
	}
}
func SearchFile(root, file string) string {
	var filePath string
	filepath.Walk(root, func(path string, f os.FileInfo, err error) error {
		if f.Name() == file {
			filePath = path
			return nil
		}
		return nil
	})
	return filePath
}
func IsSubset(first, second []string) bool {
	log.Println("subset : ", first)
	log.Println("set : ", second)
	set := make(map[string]int)
	for _, value := range second {
		set[value] += 1
	}
	for _, value := range first {
		if count, found := set[value]; !found {
			return false
		} else if count < 1 {
			return false
		} else {
			set[value] = count - 1
		}
	}
	return true
}
func CheckFileExist(file string) bool {
	if _, err := os.Stat(file); os.IsNotExist(err) {
		log.Printf("File %s does not exist", file)
		return false
	}
	return true
}