Correlations: Add better handling to correlation type and update documentation (#109922)
* Add better type handling when correlation is created from provisioning and fix documentation * add external example * change error when deprecated key is used
This commit is contained in:
@@ -30,7 +30,7 @@ func (s CorrelationsService) createCorrelation(ctx context.Context, cmd CreateCo
|
||||
if correlation.Config.Type == CorrelationType("query") {
|
||||
correlation.Type = CorrelationType("query")
|
||||
} else if correlation.Config.Type != "" {
|
||||
return correlation, ErrInvalidConfigType
|
||||
return correlation, ErrConfigTypeDeprecated
|
||||
}
|
||||
|
||||
err := s.SQLStore.WithTransactionalDbSession(ctx, func(session *db.Session) error {
|
||||
|
||||
@@ -20,7 +20,7 @@ var (
|
||||
ErrTransformationRegexReqExp = errors.New("regex transformations require expression")
|
||||
ErrCorrelationsQuotaFailed = errors.New("error getting correlations quota")
|
||||
ErrCorrelationsQuotaReached = errors.New("correlations quota reached")
|
||||
ErrInvalidConfigType = errors.New("correlation contains non default value in config.type")
|
||||
ErrConfigTypeDeprecated = errors.New("config.type is deprecated; please move type to be sibling of config")
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user