summaryrefslogtreecommitdiff
path: root/pkg/machine
Commit message (Collapse)AuthorAge
* Merge pull request #14824 from shanesmith/silence-machine-ssh-locale-warningopenshift-ci[bot]2022-07-05
|\ | | | | Silence setlocale warnings from `podman machine ssh`
| * Silence setlocale warnings from `podman machine ssh`Shane Smith2022-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connecting with `podman machine ssh` can results in the following warning: ``` /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8) /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8) /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8) /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8) ``` Best would probably be to remove `LC_ALL` (and other locale and lang env vars) from `/etc/ssh/sshd_config.d/50-redhat.conf` in the CoreOS image, but I'm not terribly sure how, so this is a quick alternative. [NO NEW TESTS NEEDED] Signed-off-by: Shane Smith <shane.smith@shopify.com>
* | pkg/machine: add missing build tags to testsPaul Holzinger2022-07-04
|/ | | | | | | | | Machine can only run on amd64 and arm64 platforms so we need to make sure the test are only run on those platforms. We do not have CI checks for this but it fails in debian build infra since debian supports many other architectures as well. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Merge pull request #14704 from baude/machinestoppedopenshift-ci[bot]2022-06-30
|\ | | | | reveal machine error, ignore false state
| * reveal machine error, ignore false stateBrent Baude2022-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR covers two edge cases discovered by fiddling with machine manually. It is possible (like after a manual cleanup of a machine) that a leftover qemu socket file can indicate the prescense of a machine running. Also, reveal the error of a Exec.Command by wrapping the generic error around what was in stderr. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
* | Merge pull request #14666 from shanesmith/machine-pidfileopenshift-ci[bot]2022-06-29
|\ \ | | | | | | Make `podman machine stop` wait for qemu to exit
| * | Make `podman machine stop` wait for qemu to exitShane Smith2022-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New `VMPidFilePath` field in MachineVM config holds the path for the qemu PID file - qemu is now started with the `-pidfile` argument set to `VMPidFilePath` - Machines created before this won't have the VM PID file configured, stopping these VMs will revert back to waiting on the state to change away from `Running`, plus an added 2s sleep to give time for the VM to exit and to avoid potential issues - Machines created after this will have a VM PID file configured and stopping the machine will wait indefinitely for the VM to exit [NO NEW TESTS NEEDED] Signed-off-by: Shane Smith <shane.smith@shopify.com>
* | | Show starting state when machine is startingDaniel J Walsh2022-06-27
| |/ |/| | | | | | | | | | | | | | | | | Currently podman machine list never shows the starting state. Fixes: https://github.com/containers/podman/issues/14738 [NO NEW TESTS NEEDED] Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #14695 from boaz0/closes_14682openshift-ci[bot]2022-06-27
|\ \ | | | | | | Fix machine list: --format implies --noheading
| * | Use HaveLen instead of len in podman machine list e2e testsBoaz Shuster2022-06-23
| | | | | | | | | | | | Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
| * | Fix machine list: --format implies --noheadingBoaz Shuster2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like previously if --format was changed then listFlag.noHeading is changed accordingly however printHeader is used to determine whether to print header or not. This patch fixes that problem. Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
* | | Fix spelling "setup" -> "set up" and similarErik Sjölund2022-06-22
|/ / | | | | | | | | | | | | | | | | | | * Replace "setup", "lookup", "cleanup", "backup" with "set up", "look up", "clean up", "back up" when used as verbs. Replace also variations of those. * Improve language in a few places. Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
* | Merge pull request #14610 from shanesmith/fix-machine-start-interruptopenshift-ci[bot]2022-06-16
|\ \ | | | | | | Fix interrupting machine start leaves the machine unstartable
| * | Fix interrupting machine start leaves the machine unstartableShane Smith2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interrupting a `podman machine start` (ex: with CTRL-C) would leave `Starting: true` in the machine's config file. Due to #14469 any subsequent starts would fail since Podman would think the machine is still in the process of starting. Fixed here by listening for the interrupt signal and setting `Starting: false` in the event. [NO NEW TESTS NEEDED] Signed-off-by: Shane Smith <shane.smith@shopify.com>
* | | Merge pull request #14570 from Clivar/fix-windows-ssh-key-creationopenshift-ci[bot]2022-06-16
|\ \ \ | |/ / |/| | Fix: Use absolute path to WSL binary to create ssh keys for `machine init` on Windows (Issue #14416)
| * | Fix #14416: Use absolute path to WSL binary to create ssh keys for `machine ↵Clivar2022-06-15
| | | | | | | | | | | | | | | | | | init` Signed-off-by: Clivar <16317699+Clivar@users.noreply.github.com>
* | | Merge pull request #14585 from Luap99/nolintopenshift-ci[bot]2022-06-14
|\ \ \ | | | | | | | | golangci-lint: enable nolintlint
| * | | golangci-lint: enable nolintlintPaul Holzinger2022-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nolintlint linter does not deny the use of `//nolint` Instead it allows us to enforce a common nolint style: - force that a linter name must be specified - do not add a space between `//` and `nolint` - make sure nolint is only used when there is actually a problem Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | | Merge pull request #14324 from anjannath/qemu-testopenshift-ci[bot]2022-06-14
|\ \ \ \ | |/ / / |/| | | [macos: podman-machine] look for firmware (edk2-code-fd) based on the path of qemu binary
| * | | look for firmware based on the path of qemu binaryAnjan Nath2022-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this allows users to use a qemu installation that is not in the default /usr/local/bin location a user can configure engine.helper_binaries_dir key or update PATH to include the installation location to find the qemu binary [NO NEW TESTS NEEDED] Signed-off-by: Anjan Nath <kaludios@gmail.com>
* | | | Merge pull request #14563 from ashley-cui/qemuopenshift-ci[bot]2022-06-13
|\ \ \ \ | |_|/ / |/| | | Fix M1 QEMU flags
| * | | Fix M1 QEMU flagsAshley Cui2022-06-10
| | |/ | |/| | | | | | | | | | | | | | | | | | | When calling QEMU, the CPU arch should be host, and highmem should be on, or else the VM start fails. [NO NEW TESTS NEEDED] Signed-off-by: Ashley Cui <acui@redhat.com>
* | | Merge pull request #14469 from shanesmith/prevent-simultaneous-machine-startsOpenShift Merge Robot2022-06-09
|\ \ \ | |/ / |/| | Prevent simultaneous machine starts
| * | Introduce 'Starting' status for machinesShane Smith2022-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The State() function now returns machine.Starting status instead of an empty string if the VM is in the process of starting. - The `CheckExclusiveActiveVM()` function returns `true` to prevent starting a VM while another is in the process of starting. - `podman machine ls` displays "Currently starting" under "Last Up" for the starting VM - `podman machine ls` supports `{{.Starting}}` boolean field in the format - `podman machine inspect` displays "starting" in the "State" field for the starting VM Signed-off-by: Shane Smith <shane.smith@shopify.com>
| * | Prevent simultaneous machine startsShane Smith2022-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running `podman machine start` twice at the same time in different terminals, for example, will make the second invocation fail and the first one hang. [NO NEW TESTS NEEDED] Signed-off-by: Shane Smith <shane.smith@shopify.com>
* | | Stop machine before force removing filesShane Smith2022-06-02
|/ / | | | | | | | | | | | | | | | | | | In #13466 the ability to force remove a machine while it's running was added but it did not first stop the machine, all files get deleted but the qemu VM would essentially be orphaned. [NO NEW TESTS NEEDED] Signed-off-by: Shane Smith <shane.smith@shopify.com>
* | Merge pull request #14417 from Luap99/machine-sshOpenShift Merge Robot2022-06-02
|\ \ | | | | | | podman machine ssh: set correct exit code
| * | podman machine ssh: do not print warning everytimePaul Holzinger2022-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currenlty this ssh warning is printed everytime: `Warning: Permanently added '[localhost]:33915' (ED25519) to the list of known hosts.` Since this is very anoying and makes it harder to capture the actual command output we should silence this. With log level error we will only see the important messages from ssh. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * | podman machine ssh: set correct exit codePaul Holzinger2022-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Forward the ssh exit code to the podman caller. This is useful for scripts. Use the same logic as podman unshare. Fixes #14401 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #14448 from baude/issue14231OpenShift Merge Robot2022-06-02
|\ \ \ | | | | | | | | expose podman.sock in machine inspect
| * | | expose podman.sock in machine inspectBrent Baude2022-06-01
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | For consumers of the podman.sock who want a predictable way to find the podman sock, we now include it under 'ConnectionConfig' in podman machine inspect. Fixes: #14231 Signed-off-by: Brent Baude <bbaude@redhat.com>
* / / Removed `imageStream` hardcoded valueJake Correnti2022-06-01
|/ / | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] Removed `imageStream` hardcoded value that was set to testing. Since podman4 is in the fcos trees, it should be removed. The respective comments have also been removed. Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
* | Fix codespell errorsDaniel J Walsh2022-05-25
| | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Use containers/common/pkg/util.StringToSliceDaniel J Walsh2022-05-23
|/ | | | | | [NO NEW TESTS NEEDED] Just code cleanup for better reuse Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Update WSL machine OS to enable user lingeringJason T. Greene2022-05-15
| | | | | | Also migrate old machines that were missing this setting Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* Add more machine testsAshley Cui2022-05-10
| | | | | | Add more machine tests for flags in init, inspect, and list. Signed-off-by: Ashley Cui <acui@redhat.com>
* Merge pull request #14129 from Juneezee/test/t.TempDirOpenShift Merge Robot2022-05-06
|\ | | | | test: use `T.TempDir` to create temporary test directory
| * test: use `T.TempDir` to create temporary test directoryEng Zer Jun2022-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The directory created by `t.TempDir` is automatically removed when the test and all its subtests complete. Prior to this commit, temporary directory created using `ioutil.TempDir` needs to be removed manually by calling `os.RemoveAll`, which is omitted in some tests. The error handling boilerplate e.g. defer func() { if err := os.RemoveAll(dir); err != nil { t.Fatal(err) } } is also tedious, but `t.TempDir` handles this for us nicely. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* | Merge pull request #14066 from ashley-cui/sysresOpenShift Merge Robot2022-05-04
|\ \ | |/ |/| podman system reset removed machines incorrectly
| * podman system reset removed machines incorrectlyAshley Cui2022-05-04
| | | | | | | | | | | | | | podman system reset did not clean up machines fully, leaving some config files, and breaking machines. Now it removes all machines files fully. Signed-off-by: Ashley Cui <acui@redhat.com>
* | Implement --format for machine inspectJhon Honce2022-05-03
|/ | | | | | * Fix issue of nil pointer derefence Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Implement machine inspect for WSLJason T. Greene2022-05-01
| | | | Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* enable errcheck linterPaul Holzinger2022-04-29
| | | | | | | | The errcheck linter makes sure that errors are always check and not ignored by accident. It spotted a lot of unchecked errors, mostly in the tests but also some real problem in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Merge pull request #14033 from baude/inspectredoOpenShift Merge Robot2022-04-28
|\ | | | | Refactor machine inspect
| * Refactor machine inspectBrent Baude2022-04-28
| | | | | | | | | | | | | | | | | | | | I was asked to refactor machine inspect output to represent more common and basic information. machine inspect now has information that would be appropriate for different machines. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
* | Merge pull request #14024 from cdoern/machineOpenShift Merge Robot2022-04-28
|\ \ | |/ |/| podman machine starting test
| * podman machine starting testcdoern2022-04-27
| | | | | | | | | | | | | | | | | | | | | | | | add a test to make sure machines are not running while still starting in order to do this, I added a parameter to `run()` to delineate whether or not the command should block or not. The non blocking run allows for tests to get and use the `machineSession` pointer and check the exit code to see if it has finished. also fix a bug (created by #13996) that before started, the machines would always say "LastUp" and "Created" Less than one second ago Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
* | Produce better test error messagesBrent Baude2022-04-27
| | | | | | | | | | | | | | As Ed has pointed out, the form of Expect(session).To(Exit(0)) provides much better error messages. Let's make Ed happy. Signed-off-by: Brent Baude <bbaude@redhat.com>
* | Merge pull request #13953 from ashley-cui/machOpenShift Merge Robot2022-04-27
|\ \ | | | | | | Allow changing of CPUs, Memory, and Disk Size
| * | Allow changing of CPUs, Memory, and Disk SizeAshley Cui2022-04-27
| |/ | | | | | | | | | | | | | | | | Allow podman machine set to change CPUs, Memory and Disk size of a QEMU machine after its been created. Disk size can only be increased. If one setting fails to be changed, the other settings will still be applied. Signed-off-by: Ashley Cui <acui@redhat.com>