Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruler: Rule group not found API message #5362

Merged
merged 4 commits into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/ruler/rulestore/objectclient/rule_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewRuleStore(client chunk.ObjectClient, loadConcurrency int, logger log.Log
func (o *RuleStore) getRuleGroup(ctx context.Context, objectKey string, rg *rulespb.RuleGroupDesc) (*rulespb.RuleGroupDesc, error) {
reader, _, err := o.client.GetObject(ctx, objectKey)
if err != nil {
if err.Error() == chunk.ErrStorageObjectNotFound.Error() {
if o.client.IsObjectNotFoundErr(err) {
level.Debug(o.logger).Log("msg", "rule group does not exist", "name", objectKey)
return nil, errors.Wrapf(rulestore.ErrGroupNotFound, "get rule group user=%q, namespace=%q, name=%q", rg.GetUser(), rg.GetNamespace(), rg.GetName())
}
Expand Down Expand Up @@ -214,7 +214,7 @@ func (o *RuleStore) SetRuleGroup(ctx context.Context, userID string, namespace s
func (o *RuleStore) DeleteRuleGroup(ctx context.Context, userID string, namespace string, groupName string) error {
objectKey := generateRuleObjectKey(userID, namespace, groupName)
err := o.client.DeleteObject(ctx, objectKey)
if err == chunk.ErrStorageObjectNotFound {
if o.client.IsObjectNotFoundErr(err) {
return rulestore.ErrGroupNotFound
}
return err
Expand Down