// ParseConfig parses notifications configuration from the provided config map and secret.
ParseConfig parses notifications configuration from the provided config map and secret.
// ParseConfig parses notifications configuration from the provided config map and secret .
func ParseConfig(configMap *v1.ConfigMap, secret *v1.Secret, defaultCfg Config, argocdService argocd.Service) (map[string]triggers.Trigger, map[string]notifiers.Notifier, *Config, error) {
	cfg, err := ParseConfigMap(configMap)
	if err != nil {
		return nil, nil, nil, err
	}
	cfg, err = defaultCfg.Merge(cfg)
	if err != nil {
		return nil, nil, nil, err
	}
	t, err := triggers.GetTriggers(cfg.Templates, cfg.Triggers, argocdService)
	if err != nil {
		return nil, nil, nil, err
	}
	notifiersConfig, err := ParseSecret(secret)
	if err != nil {
		return nil, nil, nil, err
	}
	return t, notifiers.GetAll(notifiersConfig), cfg, nil
}
func ParseConfig ( configMap * v1 . ConfigMap , secret * v1 . Secret , defaultCfg Config , argocdService argocd . Service ) ( map [ string ] triggers . Trigger , map [ string ] notifiers . Notifier , * Config , error ) { cfg , err := ParseConfigMap ( configMap ) if err != nil { return nil , nil , nil , err } cfg , err = defaultCfg . Merge ( cfg ) if err != nil { return nil , nil , nil , err } t , err := triggers . GetTriggers ( cfg . Templates , cfg . Triggers , argocdService ) if err != nil { return nil , nil , nil , err } notifiersConfig , err := ParseSecret ( secret ) if err != nil { return nil , nil , nil , err } return t , notifiers . GetAll ( notifiersConfig ) , cfg , nil }
ParseConfig parses notifications configuration from the provided config map and secret.
ParseConfig parses notifications configuration from the provided config map and secret .