-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(onboarding): deprecate misleading retentionPeriodHrs
key
#20798
fix(onboarding): deprecate misleading retentionPeriodHrs
key
#20798
Conversation
bfd1615
to
4b8e2b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small suggestions, not blocking in any way.
cmd/influx/setup.go
Outdated
} | ||
|
||
if setupFlags.retention != "" { | ||
dur, err := internal2.RawDurationToTimeDuration(setupFlags.retention) | ||
if err != nil { | ||
return nil, err | ||
} | ||
req.RetentionPeriod = dur | ||
secs := dur / time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better here to use the Duration.Seconds() and Duration.Nanoseconds() to hide the internal representation in the Duration? The modulo will have to change, if you do this, of course.
cmd/influxd/upgrade/setup.go
Outdated
} | ||
|
||
if options.target.retention != "" { | ||
dur, err := internal.RawDurationToTimeDuration(options.target.retention) | ||
if err != nil { | ||
return nil, err | ||
} | ||
req.RetentionPeriod = dur | ||
secs := dur / time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, can you use the Duration.Seconds() call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea, I'll play with the math
onboarding.go
Outdated
Org string `json:"org"` | ||
Bucket string `json:"bucket"` | ||
RetentionPeriodSeconds int64 `json:"retentionPeriodSeconds,omitempty"` | ||
RetentionPeriodHours time.Duration `json:"retentionPeriodHrs,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review: I meant to name this RetentionPeriodDeprecated
to emphasize that it's not actually hours
Closes #20452
Using seconds as the unit matches the create-bucket API. Need to open a matching PR in Cloud