diff --git a/.github/workflows/machine-os-pr.yml b/.github/workflows/machine-os-pr.yml index 5cf986ec76..db222ce83d 100644 --- a/.github/workflows/machine-os-pr.yml +++ b/.github/workflows/machine-os-pr.yml @@ -2,11 +2,6 @@ name: "Machine OS PR" on: pull_request_target: - # prevent action from running on older release-process branches - # TODO: remove when we move to new release flow - branches: - - 'v5.5' - - 'main' paths: - 'version/rawversion/version.go' @@ -34,8 +29,10 @@ jobs: run: | VERSION=$(curl "https://raw.githubusercontent.com/$PODMAN_REPO/$SHA/version/rawversion/version.go" | sed -n 's/^const RawVersion = \"\(.*\)\"$/\1/p') # ignore -dev version bumps unless on main - if [[ ${{github.base_ref}} != "main" ]] && [[ $VERSION == *-dev ]] ; then - echo "::warning:: SKIPPING: dev bump not on main" + if [[ $VERSION == *-dev ]] ; then + echo "::warning:: SKIPPING: dev bump" + elif [[ ${{github.base_ref}} == "main" ]] ; then + echo "::warning:: SKIPPING: main branch" elif [[ ${{github.base_ref}} == *-rhel ]] ; then echo "::warning:: SKIPPING: rhel branch" else @@ -128,9 +125,11 @@ jobs: id: pr run: | bumpbranch="pr${{github.event.number}}" + body=$(printf 'Triggered by https://github.com/%s/pull/%s\n\n```release-note\nRelease v%s\n```\n' \ + "$PODMAN_REPO" "${{github.event.number}}" "${{ steps.getversion.outputs.version }}") uri=`gh pr create \ --title "Bump Podman to v${{ steps.getversion.outputs.version }}" \ - --body "Triggered by https://github.com/$PODMAN_REPO/pull/${{github.event.number}}" \ + --body "$body" \ --head "podmanbot:$bumpbranch" \ --base "${{github.base_ref}}" \ --repo $UPSTREAM_MACHINE_OS` diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8df761895d..429456927f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -49,12 +49,16 @@ - Fixed a bug where the `podman system df` command could show a negative reclaimable size. - Fixed a bug where accessing a rootful `podman machine` VM that was not `podman-machine-default` (the default VM) with the `podman machine ssh` command would put the user into the rootless shell ([#25332](https://github.com/containers/podman/issues/25332)). - Fixed a bug where the `podman machine init` would report nonsensical memory values in error messages when trying to create a machine with more memory than the system. +- Fixed a bug where the remote Podman client's `podman start --attach` command would incorrectly print an error when run on a container created with the `--rm` option ([#25965](https://github.com/containers/podman/issues/25965)). +- Fixed a bug where the remote Podman client's `podman pull` command could hang and leak memory if the server was unexpectedly stopped or encountered an error during a pull. - Fixed a bug where the remote Podman client's `podman cp` command would, on Windows, often fail to copy files into the container due to improper handling of Windows paths ([#14862](https://github.com/containers/podman/issues/14862)). - Fixed a bug where the `podman container clone` command did not correctly copy healthcheck settings to the new container ([#21630](https://github.com/containers/podman/issues/21630)). - Fixed a bug where the `podman kube play` command would fail to start empty pods ([#25786](https://github.com/containers/podman/issues/25786)). - Fixed a bug where the `podman volume ls` command did not output headers when no volumes were present ([#25911](https://github.com/containers/podman/issues/25911)). - Fixed a bug where healthcheck configuration provided by a container's image could not be overridden unless the `--health-cmd` option was specified when creating the container ([#20212](https://github.com/containers/podman/issues/20212)). - Fixed a bug where the `--user` option to `podman create` and `podman run` could not be used with users added to the container by the `--hostuser` option ([#25805](https://github.com/containers/podman/issues/25805)). +- Fixed a bug where the `podman system reset` command on FreeBSD would incorrectly print an error. +- Fixed a bug where stopping the `podman machine start` command with SIGINT could result in machine state being incorrectly set to "Starting" ([#24416](https://github.com/containers/podman/issues/24416)). ### API - Fixed a bug where the Compat Create API for Containers ignored ulimits specified in the request when Podman was run rootless ([#25881](https://github.com/containers/podman/issues/25881)). diff --git a/pkg/machine/shim/host.go b/pkg/machine/shim/host.go index ad1d9ff4bf..3b368b4a87 100644 --- a/pkg/machine/shim/host.go +++ b/pkg/machine/shim/host.go @@ -6,10 +6,12 @@ import ( "fmt" "io" "os" + "os/signal" "path" "path/filepath" "runtime" "strings" + "syscall" "time" "github.com/containers/podman/v5/pkg/machine" @@ -440,6 +442,7 @@ func stopLocked(mc *vmconfigs.MachineConfig, mp vmconfigs.VMProvider, dirs *mach func Start(mc *vmconfigs.MachineConfig, mp vmconfigs.VMProvider, dirs *machineDefine.MachineDirs, opts machine.StartOptions) error { defaultBackoff := 500 * time.Millisecond maxBackoffs := 6 + signalChanClosed := false mc.Lock() defer mc.Unlock() @@ -471,17 +474,41 @@ func Start(mc *vmconfigs.MachineConfig, mp vmconfigs.VMProvider, dirs *machineDe } } + // if the machine cannot continue starting due to a signal, ensure the state + // reflects the machine is no longer starting + signalChan := make(chan os.Signal, 1) + signal.Notify(signalChan, os.Interrupt, syscall.SIGTERM) + go func() { + sig, ok := <-signalChan + if ok { + mc.Starting = false + logrus.Error("signal received when starting the machine: ", sig) + + if err := mc.Write(); err != nil { + logrus.Error(err) + } + + os.Exit(1) + } + }() + // Set starting to true mc.Starting = true if err := mc.Write(); err != nil { logrus.Error(err) } + // Set starting to false on exit defer func() { mc.Starting = false if err := mc.Write(); err != nil { logrus.Error(err) } + + if !signalChanClosed { + signal.Stop(signalChan) + close(signalChan) + } }() gvproxyPidFile, err := dirs.RuntimeDir.AppendToNewVMFile("gvproxy.pid", nil) @@ -557,6 +584,11 @@ func Start(mc *vmconfigs.MachineConfig, mp vmconfigs.VMProvider, dirs *machineDe return errors.New(msg) } + // now that the machine has transitioned into the running state, we don't need a goroutine listening for SIGINT or SIGTERM to handle state + signal.Stop(signalChan) + close(signalChan) + signalChanClosed = true + if err := proxyenv.ApplyProxies(mc); err != nil { return err }