diff --git a/pkg/ruler/rulestore/objectclient/rule_store.go b/pkg/ruler/rulestore/objectclient/rule_store.go index 747cf728f6cc6..b945c298af0b9 100644 --- a/pkg/ruler/rulestore/objectclient/rule_store.go +++ b/pkg/ruler/rulestore/objectclient/rule_store.go @@ -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()) } @@ -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