Skip to content
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

fix connection usage with containers.conf #16328

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/podman/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
if contextConn != nil && contextConn.Changed {
return fmt.Errorf("use of --connection and --context at the same time is not allowed")
}
// need to give our blank containers.conf all of the service destinations if we are using one.
podmanConfig.ContainersConf.Engine.ServiceDestinations = podmanConfig.ContainersConfDefaultsRO.Engine.ServiceDestinations
podmanConfig.ContainersConf.Engine.ActiveService = conn.Value.String()
if err := setupConnection(); err != nil {
return err
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/system_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ var _ = Describe("podman system connection", func() {
Expect(session.Out.Contents()).Should(BeEmpty())
Expect(session.Err.Contents()).Should(BeEmpty())

cmd = exec.Command(podmanTest.RemotePodmanBinary,
"--connection", "QA", "ps")
_, err = Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).ToNot(HaveOccurred())

uri := url.URL{
Scheme: "ssh",
User: url.User(u.Username),
Expand Down