-
Notifications
You must be signed in to change notification settings - Fork 178
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
Modified that check burst value when run the function ValidateNetprofile #1145
base: master
Are you sure you want to change the base?
Conversation
1. The burst is hard code, if want to achieve the desired performance, it's best to equal the value of bandwidth. 2. Add func ConvertBandwidth,that convert the bandwidth to bytes. 3. Modified func ValidateNetprofile. 4. Test pass on local env
@dseevr hi, I created a new branch and pushed it to the master, Please review ~, thanks |
contivmodel/contivModel.go
Outdated
@@ -3457,7 +3458,8 @@ func ValidateNetprofile(obj *Netprofile) error { | |||
return errors.New("bandwidth string invalid format") | |||
} | |||
|
|||
if obj.Burst > 10486 { | |||
bwint64 := netutils.ConvertBandwidth(obj.Bandwidth) |
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.
Where is this function? It looks like it wasn't included in the PR, but I see it in the other PR
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.
The function from the netutils.ConvertBandwidth and we use it directly()。The function will be convert the Bandwidth value, and the value type is int64.
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.
The commit may be out of date, At lease, It's cannot add the function(ConvertBandwidth), we import it directly and use it.
contivmodel/contivModel.go
Outdated
@@ -3457,7 +3458,8 @@ func ValidateNetprofile(obj *Netprofile) error { | |||
return errors.New("bandwidth string invalid format") | |||
} | |||
|
|||
if obj.Burst > 10486 { | |||
bwint64 := netutils.ConvertBandwidth(obj.Bandwidth) |
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.
The function from the netutils.ConvertBandwidth and we use it directly()。The function will be convert the Bandwidth value, and the value type is int64.
Modified that check burst value when run the function ValidateNetprofile
Type of fix: Bug Fix
Please describe:
it's best to equal the value of bandwidth.
TODO