Skip to content

Conversation

nothiaki
Copy link
Contributor

@nothiaki nothiaki commented Oct 8, 2025

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.

Add --force flag to quadlet install

Copy link
Contributor

openshift-ci bot commented Oct 8, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nothiaki
Once this PR has been reviewed and has the lgtm label, please assign ygalblum for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nothiaki nothiaki force-pushed the quadlet-install-force branch from bcfaf04 to e337abf Compare October 8, 2025 01:34
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@nothiaki nothiaki force-pushed the quadlet-install-force branch from e337abf to 239e701 Compare October 8, 2025 14:03
Copy link
Member

@Honny1 Honny1 left a 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.

@mheon
Copy link
Member

mheon commented Oct 8, 2025

Should this be renamed to --replace? Seems more obvious to me

Signed-off-by: Celso Henrique Souza Silva <[email protected]>
Fixes: containers#26930
@nothiaki nothiaki force-pushed the quadlet-install-force branch from 239e701 to ec21fba Compare October 8, 2025 19:15
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")
Copy link
Member

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
Copy link
Member

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]>
@nothiaki
Copy link
Contributor Author

nothiaki commented Oct 8, 2025

Should this be renamed to --replace? Seems more obvious to me

I also think --replace would be better than --force. Once used, it wouldn't ignore any errors, it just replace the quadlet. What do you think, @Luap99?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman quadlet update OR podman quadlet install --force
4 participants