-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
using cached config breaks --connection #16282
Comments
I can mock up a fix for this or maybe I am doing something wrong but on my machine this completely breaks any usage of --connection |
Thanks for opening the issue, @cdoern. The following diff fixes the issue on my machine: diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 7cdc74595ba3..705c1607e077 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -176,7 +176,7 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
setupConnection := func() error {
var err error
- podmanConfig.URI, podmanConfig.Identity, podmanConfig.MachineMode, err = podmanConfig.ContainersConf.ActiveDestination()
+ podmanConfig.URI, podmanConfig.Identity, podmanConfig.MachineMode, err = podmanConfig.ContainersConfDefaultsRO.ActiveDestination()
if err != nil {
return fmt.Errorf("failed to resolve active destination: %w", err)
} @cdoern would you open a PR to fix it along with tests? CI should have failed IMO. |
Sure will open today! |
@vrothberg even with this patch, my --connection is not honored. On my machine running bin/podman-remote --connection=home --log-level=debug info uses my podman machine connection each time... any ideas why this would be happening? |
There's probably another change needed. Have a look at commit 4e29ce2 and connection-related changes. |
I think the issue is config.Default is returning the wrong active service and that is then used in |
--connection was failing due to the servicedestinations array being empty on runtime. Fix by making sure the cached config is used resolves containers#16282 Signed-off-by: Charlie Doern <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
The changes introduced in #16238 seem to break --connection, which now when used always results in
Error: failed to resolve active destination: "fedora" service destination not found
due to the blank config that is returned from https://github.com/vrothberg/libpod/blob/7a9c14d6266a0883c8e95d376ffcae71c7e8621e/cmd/podman/registry/config.go#L83 resulting in an empty service destination arraySteps to reproduce the issue:
podman system connection add
podman --connection=name ps
error out
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:The text was updated successfully, but these errors were encountered: