Skip to content

Commit 925d4d8

Browse files
committed
Start: Remove the podman-machine marker file
With crc-org/snc#676, we updated the marker file for podman-machine. This PR is to make sure the marker file is removed in case of systemd mode networking.
1 parent 93a9f29 commit 925d4d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/crc/machine/start.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,16 +983,21 @@ func startMicroshift(ctx context.Context, sshRunner *crcssh.Runner, ocConfig oc.
983983
return nil
984984
}
985985

986-
// The containers.conf file has a setting called machine_enabled in the engine section,
986+
// The containers.conf/podman marker file has a setting called machine_enabled in the engine section,
987987
// which lets the podman client know that a command is running on an instance created
988988
// with the podman machine command. This allows the use of gvisor-tap-vsock when a
989989
// container is created with an exposed port. However, this setting should be disabled
990990
// for system mode networking, so that it doesn't prevent the creation of containers that
991991
// need to expose a port.
992992
// - https://github.com/crc-org/crc/issues/3515
993993
func removeContainerConfFile(sshRunner *crcssh.Runner) error {
994+
// We would keep this for older bundles compatibility and remove it after
995+
// 2.22.0 release.
994996
if _, _, err := sshRunner.RunPrivileged("remove /etc/containers/containers.conf to disable machine_enabled", "rm -fr /etc/containers/containers.conf"); err != nil {
995997
return errors.Wrap(err, "Failed to remove /etc/containers/containers.conf")
996998
}
999+
if _, _, err := sshRunner.RunPrivileged("remove /etc/containers/podman-machine marker file to disable machine_enabled", "rm -fr /etc/containers/podman-machine"); err != nil {
1000+
return errors.Wrap(err, "Failed to remove /etc/containers/podman-machine")
1001+
}
9971002
return nil
9981003
}

0 commit comments

Comments
 (0)