settings

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigMapName = "argocd-notifications-cm"
	SecretName    = "argocd-notifications-secret"
)

Variables

This section is empty.

Functions

func NewConfigMapInformer

func NewConfigMapInformer(clientset kubernetes.Interface, namespace string) cache.SharedIndexInformer

func NewSecretInformer

func NewSecretInformer(clientset kubernetes.Interface, namespace string) cache.SharedIndexInformer

func ParseSecret

func ParseSecret(secret *v1.Secret) (notifiersConfig notifiers.Config, err error)

ParseSecret retrieves configured notification services from the provided secret

Types

type Config

type Config struct {
	Triggers      []triggers.NotificationTrigger  `json:"triggers"`
	Templates     []triggers.NotificationTemplate `json:"templates"`
	Context       map[string]string               `json:"context"`
	Subscriptions DefaultSubscriptions            `json:"subscriptions"`
}

func ParseConfigMap

func ParseConfigMap(configMap *v1.ConfigMap) (cfg *Config, err error)

ParseSecret retrieves configured templates and triggers from the provided config map

func (*Config) Merge

func (cfg *Config) Merge(other *Config) *Config

type DefaultSubscriptions added in v0.6.1

type DefaultSubscriptions []Subscription

func (DefaultSubscriptions) GetRecipients added in v0.6.1

func (subscriptions DefaultSubscriptions) GetRecipients(trigger string, labels map[string]string) []string

Returns list of recipients for the specified trigger

type Subscription added in v0.6.1

type Subscription struct {
	// Recipients comma separated list of recipients
	Recipients []string
	// Optional trigger name
	Triggers []string
	// Options label selector that limits applied applications
	Selector labels.Selector
}

DefaultSubscription holds recipients that receives notification by default.

func (*Subscription) MatchesTrigger added in v0.6.1

func (s *Subscription) MatchesTrigger(trigger string) bool

func (*Subscription) UnmarshalJSON added in v0.6.1

func (s *Subscription) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL