Skip to content

Commit

Permalink
Drop run healthcheck action from container kebab menu
Browse files Browse the repository at this point in the history
Running a healthcheck is automated in containers so this action does not
need to be prominently advertised in our UI. The health detail tab still
has a button to perform a healtcheck if the user is willing to do so
manually.
  • Loading branch information
jelly committed Jan 16, 2025
1 parent da8fcbe commit eaa3eac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
21 changes: 1 addition & 20 deletions src/Containers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import '@patternfly/patternfly/utilities/Accessibility/accessibility.css';

const _ = cockpit.gettext;

const ContainerActions = ({ container, healthcheck, onAddNotification, localImages, updateContainer, isSystemdService }) => {
const ContainerActions = ({ container, onAddNotification, localImages, updateContainer, isSystemdService }) => {
const Dialogs = useDialogs();
const { version } = utils.usePodmanInfo();
const isRunning = container.State.Status == "running";
Expand Down Expand Up @@ -116,14 +116,6 @@ const ContainerActions = ({ container, healthcheck, onAddNotification, localImag
localImages={localImages} />);
};

const runHealthcheck = () => {
client.runHealthcheck(container.isSystem, container.Id)
.catch(ex => {
const error = cockpit.format(_("Failed to run health check on container $0"), container.Name); // not-covered: OS error
onAddNotification({ type: 'danger', error, errorDetail: ex.message });
});
};

const restartContainer = (force) => {
const args = {};

Expand Down Expand Up @@ -245,16 +237,6 @@ const ContainerActions = ({ container, healthcheck, onAddNotification, localImag
</DropdownItem>
);

if (isRunning && healthcheck !== "") {
actions.push(<Divider key="separator-1-1" />);
actions.push(
<DropdownItem key="healthcheck"
onClick={() => runHealthcheck()}>
{_("Run health check")}
</DropdownItem>
);
}

actions.push(<Divider key="separator-2" />);
actions.push(
<DropdownItem key="delete"
Expand Down Expand Up @@ -429,7 +411,6 @@ class Containers extends React.Component {
if (!container.isDownloading) {
columns.push({
title: <ContainerActions container={container}
healthcheck={healthcheck}
onAddNotification={this.props.onAddNotification}
localImages={localImages}
updateContainer={this.props.updateContainer}
Expand Down
5 changes: 1 addition & 4 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -1400,9 +1400,6 @@ WantedBy=multi-user.target default.target
# Check that the restore option is not present
b.wait_not_present(self.getContainerAction('swamped-crate', 'Restore'))

# Health check is not set up
b.wait_not_present(self.getContainerAction('swamped-crate', 'Run health check'))

b.click("#containers-containers tbody tr:contains('swamped-crate') .pf-v5-c-menu-toggle")

# Start the container
Expand Down Expand Up @@ -2719,7 +2716,7 @@ WantedBy=multi-user.target default.target
# Trigger run manually, adds one more healthy run
if self.machine.image == "ubuntu-2204":
time.sleep(5) # wait a bit, otherwise the request might be ignored
self.performContainerAction("healthy", "Run health check")
b.click(".ct-listing-panel-body button:contains('Run health check')")
b.wait_visible(".ct-listing-panel-body tbody:nth-of-type(2) svg.green")
b.wait_not_present(".ct-listing-panel-body tbody:nth-of-type(3)")

Expand Down

0 comments on commit eaa3eac

Please sign in to comment.