custom alerting resolve conflicts

Signed-off-by: junotx <junotx@126.com>
This commit is contained in:
junotx
2021-01-07 17:32:37 +08:00
parent 9831eb3533
commit 6f9d306368
37 changed files with 14 additions and 3053 deletions

View File

@@ -22,7 +22,7 @@ const (
var (
maxSecretSize = corev1.MaxSecretSize
maxConfigMapDataSize = int(float64(maxSecretSize) * 0.3)
maxConfigMapDataSize = int(float64(maxSecretSize) * 0.45)
errOutOfConfigMapSize = errors.New("out of config map size")
)
@@ -124,7 +124,7 @@ func (r *ruleResource) updateAlertingRule(groupName string, rule *promresourcesv
}
npr.Spec.Groups = groups
content, err := yaml.Marshal(npr)
content, err := yaml.Marshal(npr.Spec)
if err != nil {
return false, errors.Wrap(err, "failed to unmarshal content")
}
@@ -160,7 +160,7 @@ func (r *ruleResource) addAlertingRule(group string, rule *promresourcesv1.Rule)
})
}
content, err := yaml.Marshal(npr)
content, err := yaml.Marshal(npr.Spec)
if err != nil {
return false, errors.Wrap(err, "failed to unmarshal content")
}