-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add docker pause functionality #317
Add docker pause functionality #317
Conversation
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
d7ba2c4
to
7e1110a
Compare
Actually I've just tested this out locally and looks like we're missing a loading state when pausing. Also, would we be able to add a similar keybinding for the services view so that it's consistent with the containers view? The services view appears when running lazydocker in a docker compose project |
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.
changing to 'changes requested' for my own bookkeeping. Lemme know if you need any pointers :)
We sure could! I'll also add the required test files for future development since I don't usually use The |
@mark2185 yep 'pausing' works (lowercase for consistency with other loading statuses) |
0c2730b
to
3015560
Compare
I walked back on adding necessary test files since the change was simple and I don't think I'll use |
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.
Looking good, just a couple things. Happy to test upon next review
pkg/gui/containers_panel.go
Outdated
return nil | ||
} | ||
|
||
return gui.WithWaitingStatus(gui.Tr.PausingStatus, func() error { |
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'd extract this part out into its own function and call that from handleServicePause so that we're not duplicating the logic
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've pushed it in a new commit so when you find the time you can easily test out the automatic recognizing of pausedness (I know it's not a word, but I do think it should be, haters be damned).
return gui.createErrorPanel(gui.g, err.Error()) | ||
} | ||
|
||
return gui.refreshContainersAndServices() |
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'd see how it goes without this line here. Lazydocker should automatically recognise that the container is paused and then refresh accordingly
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 does not.
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've done some digging and this looks to be an actual bug in the docker package where we refetch container info after docker tells us there's been a change but the change doesn't come through. Crazy!
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.
Alright, now that we have the murderer, what are we going to do with it? The victim is apparently fine with gui.refreshContainersAndServices()
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.
Yeah let's just stick to calling refreshContainersAndServices
and we can look into the deeper issue in another PR
3015560
to
a03f550
Compare
nice work @mark2185 |
I'm not sure what to do about translations, though.