INNER CODE UNIT · Go

crToModel

grafana/grafana-operator · controllers/alertrulegroup_controller.go:174

func crToModel(cr *v1beta1.GrafanaAlertRuleGroup, folderUID string) (models.AlertRuleGroup, error) {
	groupName := cr.GroupName()

	mRules := make(models.ProvisionedAlertRules, 0, len(cr.Spec.Rules))

	for _, r := range cr.Spec.Rules {
		apiRule := &models.ProvisionedAlertRule{
			Annotations:  r.Annotations,
			Condition:    &r.Condition,
			Data:         make([]*models.AlertQuery, len(r.Data)),
			ExecErrState: &r.ExecErrState,
			FolderUID:    &folderUID,
			IsPaused:     r.IsPaused,
			Labels:       r.Labels,
			NoDataState:  r.NoDataState,
			RuleGroup:    &groupName,
			Title:        &r.Title,
			UID:          r.UID,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…