Fix typo cloudfront updatefrenquency
Signed-off-by: Tom Hayward <thayward@infoblox.com>
This commit is contained in:
parent
bdf3438b52
commit
0f5e2753a6
2 changed files with 11 additions and 6 deletions
|
@ -111,16 +111,21 @@ func newCloudFrontStorageMiddleware(storageDriver storagedriver.StorageDriver, o
|
|||
}
|
||||
}
|
||||
|
||||
// parse updatefrenquency
|
||||
// parse updatefrequency
|
||||
updateFrequency := defaultUpdateFrequency
|
||||
if u, ok := options["updatefrenquency"]; ok {
|
||||
// #2447 introduced a typo. Support it for backward compatibility.
|
||||
if _, ok := options["updatefrenquency"]; ok {
|
||||
options["updatefrequency"] = options["updatefrenquency"]
|
||||
dcontext.GetLogger(context.Background()).Warn("cloudfront updatefrenquency is deprecated. Please use updatefrequency")
|
||||
}
|
||||
if u, ok := options["updatefrequency"]; ok {
|
||||
switch u := u.(type) {
|
||||
case time.Duration:
|
||||
updateFrequency = u
|
||||
case string:
|
||||
updateFreq, err := time.ParseDuration(u)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid updatefrenquency: %s", err)
|
||||
return nil, fmt.Errorf("invalid updatefrequency: %s", err)
|
||||
}
|
||||
duration = updateFreq
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue