-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix drive name of volume at startup if needed #873
fix drive name of volume at startup if needed #873
Conversation
I need to test this on real machines before merging |
16e63a7
to
3b1ae6d
Compare
3b1ae6d
to
01ff2d8
Compare
volume := object.(*types.Volume) | ||
if !volume.GetDeletionTimestamp().IsZero() { | ||
return handler.delete(ctx, volume) | ||
} | ||
|
||
if eventType == controller.AddEvent { |
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.
For existing volumes, Add
event occurs only at start of the controller. This is same as added into Sync()
. As volumes live for very long, we could add drive name update every day once in future.
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 you want to keep this in Update event handler? The reason i added this in Add event handler is because, this can happen only during the node restarts mostly.
Adding this in Update handler, makes these repeated GET calls to the respective drive objects.
If the drive order can change at runtime (considering it as a rare event), can we suggest them to restart the pods instead of checking everytimea at the update handler?
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.
Yep. We will add it later.
When a node-server starts, it syncs the drive states like drive name, capacity, make etc. This is because, the drive order wouldv'e changed during node restarts. In such scenarios, We need to also make sure to fix the drive name in corresponding volumes. Without this fix, the `kubectl directpv list volumes` command will show wrong drive names (if the node has restarted)
01ff2d8
to
0a11728
Compare
When a node-server starts, it syncs the drive states like drive name, capacity, make etc. This is because, the drive order wouldv'e changed during node restarts.
In such scenarios, We need to also make sure to fix the drive name in corresponding volumes. Without this fix, the
kubectl directpv list volumes
command will show wrong drive names (if the node has restarted)