-
Notifications
You must be signed in to change notification settings - Fork 2.8k
cmd/podman: add force flag to quadlet install #27247
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nothiaki The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bcfaf04
to
e337abf
Compare
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
e337abf
to
239e701
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.
Thanks. At first glance, I only found one issue with the bats tests. Let's see what a CI rerun will show.
Should this be renamed to |
Signed-off-by: Celso Henrique Souza Silva <[email protected]> Fixes: containers#26930
239e701
to
ec21fba
Compare
func installFlags(cmd *cobra.Command) { | ||
flags := cmd.Flags() | ||
flags.BoolVar(&installOptions.ReloadSystemd, "reload-systemd", true, "Reload systemd after installing Quadlets") | ||
flags.BoolVarP(&installOptions.Force, "force", "f", false, "Force the installation even if the quadlet already exists") |
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.
if force
means only to replace it if it already exists, then like @mheon said, --replace
is probably more consistent with other commands?
// Whether to reload systemd after installation is completed | ||
ReloadSystemd bool | ||
// Force the installation even if the quadlet already exists | ||
Force bool |
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.
fwiw, im ok with force here too
Co-authored-by: Brent Baude <[email protected]> Signed-off-by: Celso Henrique <[email protected]>
I also think |
Fixes: #26930
Does this PR introduce a user-facing change?
Yes, this PR adds a new --force flag to the quadlet install command.
When specified, the flag forces the installation of a Quadlet even if it already exists.
This allows users to reinstall a Quadlet without needing to manually run podman quadlet rm and podman quadlet install.