Skip to content

kdumpctl: Let reset-crashkernel returns 0 for ostree if it succeeds#148

Merged
coiby merged 1 commit intorhkdump:mainfrom
coiby:ostree_reset_crashkernel_fix
Mar 23, 2026
Merged

kdumpctl: Let reset-crashkernel returns 0 for ostree if it succeeds#148
coiby merged 1 commit intorhkdump:mainfrom
coiby:ostree_reset_crashkernel_fix

Conversation

@coiby
Copy link
Member

@coiby coiby commented Mar 19, 2026

Currently, when running "kdumpctl reset-crashkernel" on ostree systems, the exit code is 1 even the command succeeds,
# kdumpctl reset-crashkernel
Staging deployment... done
Changes queued for next boot. Run "systemctl reboot" to start a reboot
# echo $?
1

This happens because the status of last command
"[[ $_reboot == yes ]] && systemctl reboot" is returned.

Return 0 when updating the crashkernel kernel parameter succeeds and return 1 otherwise.

Note the kdump/config-default-crashkernel currently doesn't fail on CoreOS because of teemtee/tmt#4718.

Currently, when running "kdumpctl reset-crashkernel" on ostree systems,
the exit code is 1 even the command succeeds,
    # kdumpctl reset-crashkernel
    Staging deployment... done
    Changes queued for next boot. Run "systemctl reboot" to start a reboot
    # echo $?
    1

This happens because the status of last command
"[[ $_reboot == yes ]] && systemctl reboot" is returned.

Return 0 when updating the crashkernel kernel parameter succeeds and
return 1 otherwise.

Note the kdump/config-default-crashkernel currently doesn't fail on
CoreOS because of teemtee/tmt#4718.

Signed-off-by: Coiby Xu <coxu@redhat.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the kdumpctl reset-crashkernel command would incorrectly report a failure (exit code 1) even when it successfully updated the crashkernel parameter on ostree systems. The change ensures that the command's exit status accurately reflects its operational outcome, improving script reliability and user experience.

Highlights

  • Corrected Exit Code: The kdumpctl reset-crashkernel command now correctly returns an exit code of 0 upon successful execution on ostree systems, instead of 1.
  • Improved Script Logic: Modified the reset_crashkernel function in kdumpctl to explicitly return 0 on success after updating the kernel command line, and 1 on failure.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly addresses the issue where kdumpctl reset-crashkernel on ostree systems would return an incorrect exit code of 1 even on success. By explicitly returning 0 after a successful update of the kernel command line and 1 otherwise, the command now provides accurate status feedback.

Copy link
Collaborator

@licliu licliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coiby coiby merged commit 63f248c into rhkdump:main Mar 23, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants