Skip to content

Commit

Permalink
Warn about the missing host.containers.internal in podman v5 with pasta
Browse files Browse the repository at this point in the history
The solution is to switch back to slirp4netns until the pasta resolves
the issue.
  # https://bbs.archlinux.org/viewtopic.php?id=296042
  # containers/podman#19213
  • Loading branch information
momeni committed Sep 5, 2024
1 parent 8ff5775 commit 4b16d50
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/adapter/db/postgres/migration/schi/loadfdw.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"strconv"
"strings"

"github.com/momeni/clean-arch/pkg/core/log"
"github.com/momeni/clean-arch/pkg/core/repo"
"github.com/momeni/clean-arch/pkg/core/usecase/migrationuc"
)
Expand Down Expand Up @@ -92,6 +93,15 @@ OPTIONS (user '%s', password '%s')`,
FROM SERVER %s
INTO %s`, remoteSchema, server, localSchema),
); err != nil {
if h == "host.containers.internal" {
log.Warn(ctx, `if database is running in a podman container,
it may fail to access the host system via host.containers.internal name
because it is not supported by "pasta" which is the new default
rootless network handler; in this case, consider switching back to
"slirp4netns" by editing /etc/containers/containers.conf file and
putting this line in the [network] section:
default_rootless_network_cmd = "slirp4netns"`)
}
return fmt.Errorf(
"importing %q foreign schema of %q server into %q: %w",
remoteSchema, server, localSchema, err,
Expand Down

0 comments on commit 4b16d50

Please sign in to comment.