-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Implement firmware version check #16
Conversation
Pull Request Test Coverage Report for Build 11104100618Details
💛 - Coveralls |
e7ad82e
to
5774509
Compare
func setFwConfigConditionsForDevice(device *v1alpha1.NicDevice) { | ||
currentFirmware := helper.NicFirmwareMap[device.Status.FirmwareVersion] | ||
recommendedFirmware := helper.NicFirmwareMap[device.Status.Type] | ||
if currentFirmware == recommendedFirmware { |
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.
@adrianchiris do we need to have '>=' here?
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.
Hi @e0ne following our discussion,
we should try to get mofed version from the system then check against recommended firmware version for the specific mofed version.
how we get the set of firmware versions recommended for a mofed version should be queriable from mofed scripts or config map if we have no choice.
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.
until mofed scripts implement this feature, let's use configmap
f1d6e06
to
d8bd72d
Compare
pkg/helper/helper.go
Outdated
return nil | ||
} | ||
|
||
func GetFwVersion(deviceId, ofed string) string { |
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.
Do we want to add some sanity checks here? What will happen if the ConfigMap has invalid format?
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.
since configmap is deployed by the operator, it will be updated with a correct format during the next reconcile loop, so I don't think we need to handle a case when user updates it manually with an incorrect data
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.
I agree that we can ignore invalid updates from users, but should we panic in this case? I would prefer to log an error and return an empty string here. I think if len(fw) != 3 { return "" }
will increase robustness of the code for free.
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.
it makes sense, I'll update my pr
pkg/helper/helper.go
Outdated
return nil | ||
} | ||
|
||
func GetFwVersion(deviceId, ofed string) string { |
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.
Let's rename it to GetRecommendedFwVersion
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.
done
Nvidia_mlx5_ConnectX-6_Dx: "101d 24.07-0.6.1 22.42.1000" | ||
Nvidia_mlx5_ConnectX-6_Lx: "101f 24.07-0.6.1 26.42.1000" | ||
Nvidia_mlx5_ConnectX-7: "1021 24.07-0.6.1 28.42.1000" | ||
Nvidia_mlx5_MT42822_BlueField-2_integrated_ConnectX-6_Dx: "a2d6 24.07-0.6.1 24.42.1000" |
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.
Do we also want to deploy this cfg map with make deploy?
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.
we do:)
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.
LGTM
No description provided.