Skip to content

pkg/rule: retain original path for rule files#1785

Merged
bwplotka merged 1 commit intothanos-io:masterfrom
simonpasquier:fix-rule-filenames
Nov 25, 2019
Merged

pkg/rule: retain original path for rule files#1785
bwplotka merged 1 commit intothanos-io:masterfrom
simonpasquier:fix-rule-filenames

Conversation

@simonpasquier
Copy link
Copy Markdown
Contributor

@simonpasquier simonpasquier commented Nov 25, 2019

This change ensures that the /api/v1/rules endpoint returns the original path of the rule file instead of the path of the temporary file generated by Thanos ruler.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

The mapping from the original rule filenames to the temporary filenames is stored in the github.com/thanos-io/thanos/pkg/rule.Manager struct.

Verification

Added end-to-end tests.

This change ensures that the /api/v1/rules endpoint returns the original
path of the rule file instead of the path of the temporary file
generated by Thanos ruler.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier
Copy link
Copy Markdown
Contributor Author

The CI failure doesn't seem to be related to the change.

Copy link
Copy Markdown
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

return &serverScheduler{
HTTP: http,
GRPC: grpc,
schedule: func(workDir string) (Exec, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much, cleaner thanks 👍

@bwplotka bwplotka merged commit e5d96c8 into thanos-io:master Nov 25, 2019
@simonpasquier simonpasquier deleted the fix-rule-filenames branch November 26, 2019 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants