summaryrefslogtreecommitdiff
path: root/pkg
Commit message (Collapse)AuthorAge
* Merge pull request #13597 from Luap99/statsOpenShift Merge Robot2022-03-23
|\ | | | | podman stats: calc CPU percentage correctly
| * podman stats: calc CPU percentage correctlyPaul Holzinger2022-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you run podman stats, the first interval always shows the wrong cpu usage. To calculate cpu percentage we get the cpu time from the cgroup and compare this against the system time between two stats. Since the first time we do not have a previous stats an empty struct is used instead. Thus we do not use the actual running time of the container but the current unix timestamp (time since Jan 1 1970). To fix this we make sure that the previous stats time is set to the container start time, when it is empty. [NO NEW TESTS NEEDED] No idea how I could create a test which would have a predictable cpu usage. See the linked bugzilla for a reproducer. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2066145 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | Explicitly use IPv4 to check if podman-machine VM is listeningBurt Holzman2022-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting a VM that has been configured with volume mounts, the podman client attempts to connect via TCP to localhost, which runs gvproxy to proxy an ephemeral port to the VM's ssh port. Previously, gvproxy was listening on all interfaces and IP addresses, but this behavior has changed to listening only on the IPv4 loopback address. Without this change, if a newer build of gvproxy is used, a podman machine configured with volume mounts will hang forever after "podman machine start" with "Waiting for VM ...". [NO NEW TESTS NEEDED] Signed-off-by: Burt Holzman <burt@fnal.gov>
* | Merge pull request #13588 from flouthoc/import-os-archOpenShift Merge Robot2022-03-23
|\ \ | | | | | | import: allow users to set `--os`, `--arch` and `--variant` of image imports
| * | import: allow users to set os, arch and variant of importsAditya R2022-03-23
| |/ | | | | | | | | | | | | | | | | | | Allows users to set `--os` , `--arch` and `--variant` of the image created from the custom import. Following is useful when user is already aware of the values which are correct for their generated rootfs Signed-off-by: Aditya R <arajan@redhat.com>
* | Update swagger to improve compatibilityJhon Honce2022-03-22
| | | | | | | | | | | | | | | | | | | | [NO NEW TESTS NEEDED] Improve swagger and handler code compatibility. Fixes #12804 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | fix a number of errcheck issuesValentin Rothberg2022-03-22
| | | | | | | | | | | | Numerous issues remain, especially in tests/e2e. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | fix a number of `godot` issuesValentin Rothberg2022-03-22
| | | | | | | | | | | | | | Still an unknown number remains but I am running out of patience. Adding dots is not the best use of my time. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable makezeroValentin Rothberg2022-03-22
| | | | | | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable nilerrValentin Rothberg2022-03-22
| | | | | | | | | | | | | | A number of cases looked suspicious, so I marked them with `FIXME`s to leave some breadcrumbs. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable wastedassignValentin Rothberg2022-03-22
| | | | | | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | linter: enable interfacerValentin Rothberg2022-03-22
|/ | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Merge pull request #13573 from vrothberg/golangci-lintOpenShift Merge Robot2022-03-21
|\ | | | | bump golangci-lint to v1.45.0
| * bump golangci-lint to v1.45.0Valentin Rothberg2022-03-21
| | | | | | | | | | | | | | | | | | | | * supports Go 1.18 * disable a number of new linters * fix minor stylecheck issues [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | podman rmi --ignoreValentin Rothberg2022-03-19
|/ | | | | | | | | | | Add an `--ignore` flag to `podman image rm` to instruct ignoring image if a specified image does not exist and to not throw an error. Other commands (e.g., `podman container rm`) already support this flag. Such an `--ignore` flag can come in handy in clean-up scripcts such as the teardown phases in the Podman tests. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Merge pull request #13523 from n1hility/tolerate-old-machineOpenShift Merge Robot2022-03-18
|\ | | | | Tolerate old machine images, but warn they should be recreated
| * Handle incompatible machinesJason T. Greene2022-03-18
| | | | | | | | | | | | Start in a reduced mode for recovery, warn, and provide instructions to recreate them Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* | go fmt: use go 1.18 conditional-build syntaxValentin Rothberg2022-03-18
|/ | | | Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Merge pull request #13530 from vrothberg/fix-13529OpenShift Merge Robot2022-03-17
|\ | | | | podman create: building local pause image: do not read ignore files
| * podman create: building local pause image: do not read ignore filesValentin Rothberg2022-03-17
| | | | | | | | | | | | | | | | | | Make sure to ignore local {container,docker}ignore files when building a local pause image. Otherwise, we may mistakenly not be able to copy catatonit into the build container. Fixes: #13529 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | Merge pull request #13527 from machacekondra/set_raw_image_name_for_play_kubeOpenShift Merge Robot2022-03-17
|\ \ | | | | | | Set rawimage for containers created via play kube
| * | Set rawimage for containers created via play kubeOndra Machacek2022-03-16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This commit set the containers RawImageName to default image name specified in Pod YAML, so the containers could be used via autoupdate feature, which needs the RawImageName to be set. Currently RawImageName is set only for the create/run/clone podman commands. [NO NEW TESTS NEEDED] Signed-off-by: Ondra Machacek <omachace@redhat.com>
* / Separator is no longer prepended when prefix is empty on podman generate systemdNirmal Patel2022-03-16
|/ | | | | | | | | | | | | | When podman generate systemd is invoked, it previously did not check if container-prefix or pod-prefix are empty. When these are empty, the file name starts with the separator, which is hyphen by default. This results in files like '-containername.service'. The code now checks if these prefixes are empty. If they are, the filename no longer adds a separator. Instead, it uses name or ID of the container or pod. Closes #13272 Signed-off-by: Nirmal Patel <npate012@gmail.com>
* Merge pull request #13489 from Luap99/k8sOpenShift Merge Robot2022-03-16
|\ | | | | move k8s deps into podman
| * pkg/k8s.io: add small readme with copyright noticePaul Holzinger2022-03-15
| | | | | | | | Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * pkg/k8s.io/api/core/v1: remove unneeded typesPaul Holzinger2022-03-15
| | | | | | | | | | | | | | | | Remove types that are not applicable for podman. This are types I do not think we need, there is definitely more that could be removed but this should be handled by someone who knows the k8s code better than me. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * pkg/k8s.io/...: remove more unneeded filesPaul Holzinger2022-03-15
| | | | | | | | | | | | We do not use the types defined in these fields. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * pkg/k8s.io/...: remove protobuf field tagsPaul Holzinger2022-03-15
| | | | | | | | | | | | | | | | | | | | | | Since we do not use protobuf we can remove these field tags. This will save some KB in the final binary size. This change was automated with the following commands: find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\sprotobuf\:\".*\"//g' {} + find pkg/k8s.io/ -type f -name "*.go" -exec sed -i -e 's/\s`protobuf\:\".*\"`//g' {} + Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * pkg/k8s.io/...: fix lint errorsPaul Holzinger2022-03-15
| | | | | | | | | | | | | | | | | | | | | | Fix linting errors. We use different/stricter linters, instead of skipping these packages we should fix it. Most errors are about naming conventions, since I do not want to change the names I added the nolint comment there. I also removed some unused fields where the linter complained. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * remove unneeded k8s codePaul Holzinger2022-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a lot of unneeded code, k8s is the by far the biggest dependency in podman. We should remove as much as possible so that we only have the stuff left that we use. This is just a quick skim over the code which removes a lot of the generated code and many packages that are now unused. I know that this will be impossible to properly review. I will try to make smaller changes in follow up work. Right now this reduces about 8 MB in binary size!!! [NO NEW TESTS NEEDED] Hopefully existing tests will catch any problems. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * move k8s deps into podmanPaul Holzinger2022-03-15
| | | | | | | | | | | | | | | | We only need a small part of the k8s dependencies but they are the biggest dependencies in podman by far. Moving them into podman allows us to remove the unnecessary parts. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | fix breaking change in pkg/bindingsPaul Holzinger2022-03-15
|/ | | | | | | | | | | | | | | pkg/bindings is considered stable. We cannot make changes that would break any users. If someone uses this field their code would fail to compile. Since the fix is obviously correct we will keep it but also add the old field back in to keep compatibility with old code. When both fields are set ImportArchive is preferred over ImportAchive. Fixes changes from commit 217197340c8f [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Merge pull request #13499 from rst0git/fix-typoOpenShift Merge Robot2022-03-14
|\ | | | | Fix typo
| * Fix typoRadostin Stoyanov2022-03-14
| | | | | | | | | | | | [NO NEW TESTS NEEDED] Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
* | Add support for --chrootdirsLStandman2022-03-14
|/ | | | Signed-off-by: LStandman <65296484+LStandman@users.noreply.github.com>
* Fixes TTY & resizing on Mac and WindowsJason T. Greene2022-03-12
| | | | Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* Add podman play kube --annotationDaniel J Walsh2022-03-09
| | | | | | | | | | Allow users to add annotions in the podman play kube command. This PR Also fixes the fact that annotations in the pod spec were not being passed down to containers. Fixes: https://github.com/containers/podman/issues/12968 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #12913 from rhatdan/kubeOpenShift Merge Robot2022-03-09
|\ | | | | Add --context-dir option to podman play kube
| * Add --context-dir option to podman play kubeDaniel J Walsh2022-03-01
| | | | | | | | | | | | | | | | | | | | This option was requested so that users could specify alternate locations to find context directories for each image build. It requites the --build option to be set. Partion Fix: https://github.com/containers/podman/issues/12485 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #13471 from Luap99/bump-mpbv7OpenShift Merge Robot2022-03-09
|\ \ | | | | | | Use github.com/vbauerster/mpb/v7 in pkg/machine
| * | Use github.com/vbauerster/mpb/v7 in pkg/machinePaul Holzinger2022-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already use v7 in c/image so podman should use the same version to prevent duplication. This saves 170 KB binary size. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #13470 from Luap99/yamlv2OpenShift Merge Robot2022-03-09
|\ \ \ | |/ / |/| | use gopkg.in/yaml.v2 instead of v3
| * | use gopkg.in/yaml.v2 instead of v3Paul Holzinger2022-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many dependencies already import gopkg.in/yaml.v2, podman is the only user of the v3 version except github.com/stretchr/testify but this is only a testing dependency so it will not end up in the binary. This change reduces the podman binary size from 54740 to 54260 KB on my system. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #13421 from hshiina/device-ruleOpenShift Merge Robot2022-03-09
|\ \ \ | | | | | | | | Set default rule at the head of device configuration
| * | | Set default rule at the head of device configurationHironori Shiina2022-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default rule should be set at the head of device configuration. Otherwise, rules for user devices are overridden by the default rule so that any access to the user devices are denied. Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
* | | | Merge pull request #13465 from n1hility/improve-install-msgOpenShift Merge Robot2022-03-09
|\ \ \ \ | |_|/ / |/| | | Improve agent install message to add restart instructions
| * | | Improve agent install message to add restart instructionsJason T. Greene2022-03-08
| |/ / | | | | | | | | | Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* / / machine rm -f stops and removes machineBrent Baude2022-03-08
|/ / | | | | | | | | | | | | | | | | | | | | | | If you want to remove a running machine, you can now pass the --force/-f to podman machine rm and the machine will be stopped and removed without confirmations. Fixes: #13448 [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
* | Merge pull request #13409 from baude/virtfsdarwinOpenShift Merge Robot2022-03-07
|\ \ | | | | | | MacOS improvements
| * | MacOS improvementsBrent Baude2022-03-07
| | | | | | | | | | | | | | | | | | | | | | | | * Enable support of virtfs in Podman and darwin. At the time of this writing, it requires a special patch not yet included in upstream qemu. * Prefer to use a specially built qemu to support virtfs. The qemu is installed under libexec/podman. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>