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

Conversation

gotjosh
Copy link
Contributor

@gotjosh gotjosh commented Feb 10, 2022

We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed.

This ensures that is consistent with the error assertion that we have in the code for the ruler.

if err != nil {
if err.Error() == chunk.ErrStorageObjectNotFound.Error() {
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())
}
return nil, errors.Wrapf(err, "failed to get rule group %s", objectKey)
}

Checklist

  • Documentation added
  • Tests updated
  • Add an entry in the CHANGELOG.md about the changes.

We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed.

This ensures that is consistent with the error assertion that we have in the code for the ruler.
@gotjosh gotjosh requested a review from a team as a code owner February 10, 2022 10:59
@CLAassistant
Copy link

CLAassistant commented Feb 10, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dannykopping dannykopping merged commit 0241673 into main Feb 10, 2022
@dannykopping dannykopping deleted the fix-get-rule-groups-response branch February 10, 2022 11:28
dannykopping pushed a commit that referenced this pull request Feb 10, 2022
* Ruler: Rule group not found API message

We copied over the ruler code as part of #5089, and it seems that at the same time we stopped depending on the object storage implementation of Cortex. Turns out, there are (slight) differences between the clients which meant that response returned by the API when we try to get a rule group that is not found had changed.

This ensures that is consistent with the error assertion that we have in the code for the ruler.

* Use the method from the interfaace to determine object storage

* also include DeleteObject

* appease the linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants