func DedupeManifests(s []*Manifest) []*Manifest {
	seen := make(map[string]struct{}, len(s))
	j := 0
	for _, v := range s {
		k := fmt.Sprintf("%s:%s", v.Name, v.Tag)
		if _, ok := seen[k]; ok {
			continue
		}
		seen[k] = struct{}{}
		s[j] = v
		j++
	}
	return s[:j]
}
DedupeManifests will deduplicate a list of Manifests by name:tag
package registry
import (
	"fmt"
	"regexp"
	"time"
	"github.com/hashicorp/go-version"
	"go.uber.org/zap"
)
var (
	DefaultVersion = version.Must(version.NewVersion("0.0.0"))
	GitShaRegex = regexp.MustCompile(`^[0-9a-f]{4,}$`)
	logger, _   = zap.NewProduction()
	log         = logger.Sugar()
)
type Manifest struct {
	Name string
	Tag  string
	LastModified time.Time
	Version *version.Version
	Labels  map[string]string
}
func NewManifest(repo string, tag string, lm time.Time, labels map[string]string) (*Manifest, error) {
	var err error
	mani := Manifest{
		Name:         repo,
		Tag:          tag,
		LastModified: lm,
		Labels:       labels,
	}
	if GitShaRegex.MatchString(tag) {
		log.Debugf("Assuming default version, because %s is just a git sha", tag)
		mani.Version = DefaultVersion
	} else {
		mani.Version, err = version.NewVersion(tag)
		if err != nil {
			mani.Version = DefaultVersion
		}
	}
	return &mani, nil
}
func RemoveItems(a []*Manifest, b []*Manifest) []*Manifest {
	newa := make([]*Manifest, len(a))
	for i, x := range a {
		newa[i] = x
	}
	for _, del := range b {
		for i := 0; i < len(newa); i++ {
			if newa[i].Name == del.Name && newa[i].Tag == del.Tag {
				newa = append(newa[:i], newa[i+1:]...)
				i--  
			}
		}
	}
	return newa
}