Commit graph

15155 commits

Author SHA1 Message Date
Daniel J Walsh 7f28fd9386
Report properly whether pod shares host network
Fixes: https://github.com/containers/podman/issues/14028

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-28 10:27:21 -04:00
OpenShift Merge Robot 87454cf87a
Merge pull request #14040 from edsantiago/gomega_havefield
e2e tests: use HaveField() for better error checking
2022-04-28 10:25:46 -04:00
OpenShift Merge Robot d0b96a541d
Merge pull request #14051 from giuseppe/volume-create-noquota-option
volume: add new option -o o=noquota
2022-04-28 10:23:58 -04:00
Paul Holzinger cb9a45630f
shell completion --format: use anonymous struct field once
We should not include the anonymous twice in the suggestions.

one example is `podman network ls --format {{.` it will also show
`{{.Network` but since Network is the actual struct all fields are
already shown so there is no need for it to be suggested.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-28 15:11:25 +02:00
Paul Holzinger 8be9781586
network inspect --format: add completion for go template
Make sure to autocomplete the go template for network inspect.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-28 15:11:25 +02:00
Paul Holzinger f93ba587c6
shell completion --format: work with nil structs
AutocompleteFormat() takes the format struct as argument. Often the structs
are deeply nested and contain other structs. Up until now if there was a
pointer to a struct the logic was not able to get the field names from
that, simply because the pointer was nil. However it is possible to
create a new initialized type with reflect.New(). This allows us to
complete all struct fields/functions even when there nil pointers.
Therefore we can drop the extra initialization which was done by some
callers.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-28 15:11:21 +02:00
dependabot[bot] 589e42c990
Bump github.com/containernetworking/cni from 1.0.1 to 1.1.0
Bumps [github.com/containernetworking/cni](https://github.com/containernetworking/cni) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/containernetworking/cni/releases)
- [Commits](https://github.com/containernetworking/cni/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/cni
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-28 12:09:13 +00:00
Ed Santiago a5aea8e503 Three manual fixes
Two for this error:

    invalid indirect of pod.Spec.DNSConfig.Options[0]

...and one for a gofmt error (spaces).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-28 05:43:41 -06:00
Ed Santiago b3f38c31b2 Ginkgo: use HaveField() for better error checking
This is a very late followup to my ginkgo-improving work of 2021.
It has been stuck since December because it requires gomega 1.17,
which we've just enabled.

This commit is simply a copy-paste of a command I saved in
my TODO list many months ago:

     sed -i -e 's/Expect(\([^ ]\+\)\.\([a-zA-Z0-9]\+\))\.To(Equal(/Expect(\1).To(HaveField(\"\2\", /' test/e2e/*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-28 05:41:53 -06:00
Giuseppe Scrivano 91ead15283
volume: add new option -o o=noquota
add a new option to completely disable xfs quota usage for a volume.

xfs quota set on a volume, even just for tracking disk usage, can
cause weird errors if the volume is later re-used by a container with
a different quota projid.  More specifically, link(2) and rename(2)
might fail with EXDEV if the source file has a projid that is
different from the parent directory.

To prevent such kind of issues, the volume should be created
beforehand with `podman volume create -o o=noquota $ID`

Closes: https://github.com/containers/podman/issues/14049

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-04-28 13:29:01 +02:00
OpenShift Merge Robot 2b8cafc067
Merge pull request #14047 from vrothberg/fix-14044
podman search: truncate by default
2022-04-28 06:46:58 -04:00
Valentin Rothberg ea1fcd7bc7 podman search: truncate by default
Truncate by default to avoid long descriptions from rendering the output
unreadable.

[NO NEW TESTS NEEDED]

Fixes: #14044
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-28 09:40:46 +02:00
cdoern c721acf082 podman machine starting test
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>
2022-04-27 20:12:43 -04:00
OpenShift Merge Robot 78c66fb005
Merge pull request #14038 from baude/exited
Produce better test error messages
2022-04-27 19:58:04 -04:00
Jhon Honce 5b8db20a71
Merge pull request #14041 from edsantiago/emergency_ci_fix
[CI:DOCS] Emergency fix for new CI linter
2022-04-27 16:20:47 -07:00
Ed Santiago 3b8fa515f8 Emergency fix for new CI linter
Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-27 16:15:23 -06:00
OpenShift Merge Robot 7321f5e462
Merge pull request #14034 from rhatdan/history
Add CreatedSince & CreatedAt format fields to podman image history
2022-04-27 17:08:44 -04:00
Brent Baude 83a75d2a3d Produce better test error messages
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>
2022-04-27 15:44:02 -05:00
OpenShift Merge Robot 578ffd7700
Merge pull request #13376 from cevich/f36_update
Update to F36 CI VM Images + Testing netavark/aardvark-dns
2022-04-27 16:34:42 -04:00
OpenShift Merge Robot 60d6cc8e1e
Merge pull request #13953 from ashley-cui/mach
Allow changing of CPUs, Memory, and Disk Size
2022-04-27 16:02:57 -04:00
Ed Santiago 461b73f563 Github PR template: add release-note block
Initial step toward automating the collection & generation
of release notes: add a markdown release-note block to our
PR template. This will be reaped by an existing Kubernetes
tool and gathered into a document that can be used as a
starting point for future releases.

Many more followup steps to come.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-04-27 13:28:34 -06:00
Daniel J Walsh 22b421dd7e
Add CreatedSince & CreatedAt format fields to podman image history
Fixes: https://github.com/containers/podman/issues/14012

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-27 15:15:03 -04:00
Ashley Cui e7390f30b9 Allow changing of CPUs, Memory, and Disk Size
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>
2022-04-27 13:56:14 -04:00
Chris Evich 9c0c29f086
Cirrus: Fix ownership of repos. to keep git happy
Newer versions of git are much more pedantic about who owns the
repository files.  When setting up to run rootless, prior to this
commit, the repo. ownership was changed from root.  This causes
all subsequent git-operations as root to fail:

    ```
    fatal: unsafe repository ('<$GOSRC>' is owned by someone else)
    ```

Fix this by re-ordering operations, such that the change in ownership is
done immediately before executing as a user.  Also disable the
git-ownership check on the source repository assuming the CI environment
is disposable.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich d4e30b33a1
Temporarily skip netavark/aardvark e2e test
Ref: https://github.com/containers/podman/issues/13931

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich cf449e81ab
Cirrus: Temporarily update netavark/aardvark-dns
Normally installing/updating packages at test runtime is highly
discouraged for reliability and efficiency reasons.  However, in this
specific case, development work of these packages is still fairly hot.
As a compromise to support podman test development, temporarily update
these two specific packages at runtime.  At a future date, when updates
are less frequent, this commit can/should be safely reverted.  At that
point, the versions installed at VM image build time will persist.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich cd7cff6bb5
Cirrus: Test w/ netavark/aardvark-dns in F36+
Now that netavark and aardvark are packaged and default in F36, support
CNI-based testing in F35 and Ubuntu.

* Remove the temporary/special `$TEST_ENVIRON=host-netavark` construct.
* Remove dedicated/special integration and system testing tasks.
* Update test-config setup to properly handle CNI vs netavark/aardvark
  environments.
* Update package-version logging to operate based on installed packages
  (along with some other minor script cleanups).
* Update global environment setup to force `$NETWORK_BACKEND=netavark`
  in F36 and later.  Except when `upgrade_test` task runs.
* Discontinue installing netavark and aardvark-dns binaries from
  upstream build artifacts.
* Drop CGV1-vs-2 policy check.  Ubuntu VMs now exclusively test CGv1,
  Fedora VMs test CGv2, with F35 testing CNI and F36 testing Netavark.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich 3a07fc446e
Cirrus: Update to F36 CI VM Images
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:54 -04:00
Chris Evich a73425a0b9
Revert "Cirrus: Disable F34 aka prior-fedora testing"
This reverts commit 7b55ab4426.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-27 12:13:53 -04:00
OpenShift Merge Robot 9133a6d044
Merge pull request #13698 from Luap99/version
Bump version to v4.1.0-dev
2022-04-27 10:56:43 -04:00
OpenShift Merge Robot e4be261755
Merge pull request #14030 from containers/dependabot/go_modules/github.com/fsnotify/fsnotify-1.5.4
Bump github.com/fsnotify/fsnotify from 1.5.3 to 1.5.4
2022-04-27 10:09:06 -04:00
OpenShift Merge Robot bbe419ef9f
Merge pull request #14023 from rhatdan/kube
Truncate annotations when generating kubernetes yaml files
2022-04-27 09:42:31 -04:00
OpenShift Merge Robot c44efb0110
Merge pull request #14029 from Luap99/kube-hostnet
play kube respect hostNetwork
2022-04-27 09:32:49 -04:00
Paul Holzinger 3bcfd256b3
manifest endpoints fix ordering
OK this is a pretty bad design IMO. We have to endpoints:
manifest create: `POST /{name}`
manifest push: `POST /{name}/registry/{destination}`

So basically all push requests are valid create requests.
Fortunately we can change the order in which the endpoints are matched.
If the logic matches push first it will fall back to create if the
request does not have the `/registry/{}` part.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-27 14:57:25 +02:00
Paul Holzinger 4a4906b91f
pkg/bindings: manifest remove 3.X API support conditional
Since the minimum API version is set to 4.0.0 the endpoint will not talk
to the 3.X endpoint. Therefore this logic is broken and should just be
removed. 4.0 bindings should only talk to 4.0 server. This is already
the case for many other endpoints.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-27 14:32:36 +02:00
Paul Holzinger e9599fb1ae
fix manifest modify endpoint to respect tlsverify param
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-27 14:32:36 +02:00
Paul Holzinger 609b52f726
Bump version to v4.1.0-dev
I think we forgot to bump the version in the main branch. It should be
v4.1.0-dev now.
Also set the min api version to 4.0.0 as on the podman 4.0 branch.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-27 14:32:28 +02:00
dependabot[bot] 6529211199
Bump github.com/fsnotify/fsnotify from 1.5.3 to 1.5.4
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 12:10:46 +00:00
Paul Holzinger 70a2c00089
play kube respect hostNetwork
We need to use the host network when it is set in the config and
--network was not used.

This regression was added in 3e9af2029f.

Fixes #14015

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-27 13:28:34 +02:00
OpenShift Merge Robot 053b09660f
Merge pull request #13997 from Luap99/gocritic
enable gocritic linter
2022-04-27 04:50:01 -04:00
Daniel J Walsh 7259a6315c
Truncate annotations when generating kubernetes yaml files
Kubernetes only allows 63 characters in an annotation.  Make sure
that we only add 63 or less charaters when generating kube. Warn
if containers or pods have longer length and truncate.

Discussion: https://github.com/containers/podman/discussions/13901

Fixes: https://github.com/containers/podman/issues/13962

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-27 04:39:05 -04:00
OpenShift Merge Robot 5ac00a7287
Merge pull request #14009 from vrothberg/add-benchmarks
benchmarks: add more image benchmarks
2022-04-26 14:36:30 -04:00
OpenShift Merge Robot d504c3cf85
Merge pull request #14013 from cevich/fix_main_archive
Cirrus: Fix skipping all/most tests
2022-04-26 13:41:47 -04:00
Paul Holzinger 4f8ece76ff
play kube: do not skip containers by name
We should not exclude contianers by name. If a users has a container
with the name "inf" it is currently skipped. This is wrong. The k8s yaml
does not contain infra containers so we do not have to skip them.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-26 18:12:27 +02:00
Paul Holzinger 51fbf3da9e
enable gocritic linter
The linter ensures a common code style.
- use switch/case instead of else if
- use if instead of switch/case for single case statement
- add space between comment and text
- detect the use of defer with os.Exit()
- use short form var += "..." instead of var = var + "..."
- detect problems with append()
```
newSlice := append(orgSlice, val)
```
  This could lead to nasty bugs because the orgSlice will be changed in
  place if it has enough capacity too hold the new elements. Thus we
  newSlice might not be a copy.

Of course most of the changes are just cosmetic and do not cause any
logic errors but I think it is a good idea to enforce a common style.
This should help maintainability.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-26 18:12:22 +02:00
Chris Evich 1a9f110b59
Cirrus: Fix skipping all/most tests
The originally intent for skipping tests based on change-content was to
optimize the PR workflow.  However, a mistake in a conditional is
causing almost all tasks running for Cron and branches to be skipped.
Fix this by checking for an empty '$CIRRUS_PR' variable.  This value is
always empty when operating outside of PRs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-26 11:04:53 -04:00
OpenShift Merge Robot fc3a48232f
Merge pull request #14005 from rhatdan/VENDOR
vendor in containers/(common,buildah,storage)
2022-04-26 11:03:59 -04:00
OpenShift Merge Robot e7edf30a1b
Merge pull request #14010 from vrothberg/remote-rootless
remote: do not join user NS
2022-04-26 10:55:56 -04:00
OpenShift Merge Robot 216d924307
Merge pull request #14011 from baude/rmfiles
[CI:DOCS]Remove unnecesarry files
2022-04-26 09:37:38 -04:00
Brent Baude 7c914355d0 [CI:DOCS]Remove unnecesarry files
Removing two files that are not needed.  One is likely an accidental
check-in and the other is a empty file.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-04-26 08:22:14 -05:00