func InitializeSecretsCache(rules []AssociationRule) {
	secrets = secretsCache{
		mapping: make(map[string]map[string]bool),
		rwSync:  sync.RWMutex{},
		rules:   rules,
	}
}
InitializeSecretsCache - Generates AssociationRules from config and
initializes the global secrets cache
package bundle
import (
	"sync"
	meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"github.com/automationbroker/bundle-lib/clients"
	log "github.com/sirupsen/logrus"
)
type SecretsConfig struct {
	Name    string `yaml:"name"`
	ApbName string `yaml:"apb_name"`
	Secret  string `yaml:"secret"`
}
func (c SecretsConfig) Validate() bool {
	for _, str := range []string{c.Name, c.ApbName, c.Secret} {
		if str == "" {
			return false
		}
	}
	return true
}
type AssociationRule struct {
	BundleName string
	Secret     string
}
type secretsCache struct {
	mapping map[string]map[string]bool
	rwSync  sync.RWMutex
	rules   []AssociationRule
}
var secrets secretsCache
func getSecrets(spec *Spec) []string {
	secrets.rwSync.RLock()
	defer secrets.rwSync.RUnlock()
	keys := []string{}
	for key := range secrets.mapping[spec.FQName] {
		keys = append(keys, key)
	}
	return keys
}
func AddSecrets(specs []*Spec) {
	for _, spec := range specs {
		AddSecretsFor(spec)
	}
}
func AddSecretsFor(spec *Spec) {
	secrets.rwSync.Lock()
	defer secrets.rwSync.Unlock()
	for _, rule := range secrets.rules {
		if match(spec, rule) {
			log.Debugf("Spec %v matched rule %v", spec.FQName, rule)
			addSecret(spec, rule)
		}
	}
}
func addSecret(spec *Spec, rule AssociationRule) {
	secrets.mapping[spec.FQName] = make(map[string]bool)
	secrets.mapping[spec.FQName][rule.Secret] = true
}
func match(spec *Spec, rule AssociationRule) bool {
	return spec.FQName == rule.BundleName
}