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

Allow retention to be set only by size #4590

Merged

Conversation

heylongdacoder
Copy link
Contributor

@heylongdacoder heylongdacoder commented Feb 22, 2022

If retention size is set and retention time is not, default retention
time value will not be used. If both retention size and retention time
are set, then both values will be used.

Fixed #2883

Signed-off-by: heylongdacoder heylongdacoder@gmail.com

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


@heylongdacoder heylongdacoder requested a review from a team as a code owner February 22, 2022 16:10
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Nice! It would be good to update the description of Retention.

Default is '24h' if RetentionSize is empty.

// Time duration Prometheus shall retain data for. Default
// is '24h', and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)`
// (milliseconds seconds minutes hours days weeks years).
Retention string `json:"retention,omitempty"`

pkg/prometheus/statefulset.go Outdated Show resolved Hide resolved
If retention size is set and retention time is not, default retention
time value will not be used. If both retention size and retention time
are set, then both values will be used.

Fixed prometheus-operator#2883

Signed-off-by: heylongdacoder <heylongdacoder@gmail.com>
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@philipgough philipgough left a comment

Choose a reason for hiding this comment

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

lgtm

@philipgough philipgough merged commit f156f4f into prometheus-operator:main Feb 23, 2022
@heylongdacoder
Copy link
Contributor Author

Thanks for review :)

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.

Can't specify retention only by size
3 participants