Renaming a Podman connection to its current name deletes it
Issue Description
Running podman system connection rename with identical source and destination names silently deletes the connection while returning a successful exit code (0).
If the affected connection is the default, the configuration retains a reference to a connection that no longer exists.
Steps to reproduce the issue
The following reproducer uses isolated configuration files and does not require a running Podman engine.
podman system connection add demo unix:///run/podman/repro.sock
podman system connection list
podman system connection rename demo demo
echo "rename exit code: $?"
podman system connection list
cat "$PODMAN_CONNECTIONS_CONF"
Describe the results you received
- The
democonnection is successfully created and set as the default. - Renaming
demotodemoreturns exit code 0. - The connection is no longer present in the connection list.
- The configuration still references
demoas the default connection.
Resulting configuration:
{"Connection":{"Default":"demo"},"Farm":{}}
Describe the results you expected
Renaming a connection to its current name should be a no-op.
The connection should remain available with its original URI, settings, and default status. No configuration data should be lost.
podman info output
OS: darwin/arm64
provider: libkrun
version: 6.3.0-dev
Host: macOS 27.0.1 (build 26A434), Mac16,7.
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
No response
Additional information
No response
Hi! I'd like to work on this issue. Could you please assign it to me?
@mdiniz97 Please first read our organization-wide contributing guide: https://github.com/podman-container-tools/community/blob/main/CONTRIBUTING.md. It contains all the general recommendations on how to work with issues and how to create proper commits and PRs for the Project.