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

Add missing retention days check on update namespace API #1407

Merged
merged 2 commits into from Mar 26, 2021

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Add missing check on upper limit of retention days to UpdateNamespaceAPI

Why?
Check is missing

How did you test it?
N/A

Potential risks
N/A

Is hotfix candidate?
No

* Add missing check on upper limit of retention days to UpdateNamespaceAPI
@wxing1292 wxing1292 requested review from alexshtin and a team March 26, 2021 17:17
@wxing1292 wxing1292 enabled auto-merge (squash) March 26, 2021 17:18
@@ -56,7 +58,9 @@ func newAttrValidator(
}

func (d *AttrValidatorImpl) validateNamespaceConfig(config *persistencespb.NamespaceConfig) error {
if config.Retention != nil && *config.Retention < time.Hour*24*time.Duration(d.minRetentionDays) {
if timestamp.DurationValue(config.Retention) < time.Hour*24*time.Duration(d.minRetentionDays) {
Copy link
Member

Choose a reason for hiding this comment

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

You can use timestamp.DurationFromDays here.

@wxing1292 wxing1292 merged commit 5ab080a into temporalio:master Mar 26, 2021
@wxing1292 wxing1292 deleted the update-namespace-check branch March 26, 2021 19:09
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.

None yet

2 participants