-
Notifications
You must be signed in to change notification settings - Fork 91
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
Automatically start podman.socket #1976
Automatically start podman.socket #1976
Conversation
e714b98
to
58cd691
Compare
58cd691
to
8075969
Compare
This failure is completely independent, some internal xterm bug:
Not sure why it triggers so robustly now, changed timing or 3x affected? It rings a bell, need to check when I'm more awake. https://stackoverflow.com/questions/78116360/xtermjs-cannot-read-properties-of-undefined-reading-dimensions-v5-3-on-next |
8075969
to
f8565d1
Compare
f8565d1
to
607991d
Compare
src/ContainerLogs.jsx
Outdated
@@ -80,11 +80,14 @@ class ContainerLogs extends React.Component { | |||
} | |||
|
|||
resize(width) { | |||
if (!this.term?._core?._renderService?.dimensions) |
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.
This is a bit akward as this now depends on internals. Which I see, it already did...
607991d
to
d7de01a
Compare
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.
🤯 that is quite a nice cleanup as a result of auto starting the podman.socket!
And a great improvement for cockpit-podman 100 😉
I'll leave fixing the small typo up to you
src/app.jsx
Outdated
}); | ||
|
||
// Listen if podman is still running |
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.
Unrelated to code review, but why does this exist? I suppose to check if streaming events works as subscribing to streamEvents does nothing until an event comes along
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.
No, not at all. This is meant to update the state if/when podman.service
/.socket
gets stopped, i.e. the "close" method. I updated the comment, is it clearer now?
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.
Ah, but then we can in theory re-use podmanMonitor
for this? Except it doesn't expose the channel so we can't easily add an eventlistener to close()
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.
Seems there are some complications however, this is unrelated to your work.
We will soon add another piece of initialization at the top, and this already has too many indentation levels.
Always start the system and user `podman.socket` unit on initialization. There really is no reason to explicitly ask the user about it -- we can treat it as "extended cockpit" to just access podman. There also isn't a reason to enable the socket unit -- starting it on demand is fine from cockpit-podman's perspective. Now the user will only see the empty state if the service fails, which should be very rare. So turn the Troubleshoot button into a primary one. We also don't need the "System/User podman is also available" alerts any more -- gaining root privileges auto-starts the system service.
d7de01a
to
f4a4865
Compare
this.updatePods(system); | ||
|
||
client.streamEvents(system, message => this.handleEvent(message, system)) | ||
.catch(e => console.error("init", system ? "system" : "user", "streamEvents failed:", e.toString())) |
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.
This added line is not executed by any test.
client.streamEvents(system, message => this.handleEvent(message, system)) | ||
.catch(e => console.error("init", system ? "system" : "user", "streamEvents failed:", e.toString())) | ||
.finally(() => { | ||
this.setState({ [system ? "systemServiceAvailable" : "userServiceAvailable"]: false }); |
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.
This added line is not executed by any test.
console.log("init", system ? "system" : "user", "podman service closed"); | ||
this.setState({ [system ? "systemServiceAvailable" : "userServiceAvailable"]: false }); |
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.
These 2 added lines are not executed by any test.
Always start the system and user
podman.socket
unit on initialization. There really is no reason to explicitly ask the user about it -- we can treat it as "extended cockpit" to just access podman.There also isn't a reason to enable the socket unit -- starting it on demand is fine from cockpit-podman's perspective.
Now the user will only see the empty state if the service fails, which should be very rare. So turn the Troubleshoot button into a primary one.
We also don't need the "System/User podman is also available" alerts any more -- gaining root privileges auto-starts the system service.
This is a necessary prerequisite for https://issues.redhat.com/browse/COCKPIT-1086 , but useful in its own right -- it removes a big hurdle/annoyance at startup.
Podman: Automatically start podman.socket
If the system or user's
podman.socket
unit isn't running, cockpit-podman now silently starts it on its own, instead of asking the user about it. There is no need to have the service enabled (i.e. always start it on boot or user login) for cockpit-podman any more.