trigger type from annotations
parent
e4027db612
commit
60988005cc
|
@ -6,10 +6,18 @@ import (
|
|||
|
||||
// GetTriggerPolicy - checks for trigger label, if not set - returns
|
||||
// default trigger type
|
||||
func GetTriggerPolicy(labels map[string]string) types.TriggerType {
|
||||
func GetTriggerPolicy(labels map[string]string, annotations map[string]string) types.TriggerType {
|
||||
|
||||
triggerAnn, ok := annotations[types.KeelTriggerLabel]
|
||||
if ok {
|
||||
return types.ParseTrigger(triggerAnn)
|
||||
}
|
||||
|
||||
// checking labels
|
||||
trigger, ok := labels[types.KeelTriggerLabel]
|
||||
if ok {
|
||||
return types.ParseTrigger(trigger)
|
||||
}
|
||||
|
||||
return types.TriggerTypeDefault
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue