Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.4] Several backports of some of my recent fixes #17819

Merged
merged 9 commits into from
Mar 16, 2023

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Mar 16, 2023

Backports of:

Does this PR introduce a user-facing change?

`podman system service --log-level=trace` will now be able to hijack the client connection and thus make `podman-remote run/attach` work correctly.
podman-mac-helper now exits with 1 on error.
The docker compat API now returns 409 if you try to create a network with the same name and CheckDuplicate is set to true.
podman run --dns ... --network ... will no longer add host nameservers to resolv.conf when aardvark-dns is used.
podman logs can now read logs with the passsthrough driver when the container is run from a systemd service.

Luap99 added 9 commits March 16, 2023 15:08
We should return a proper exit code to signal the failure.

[NO NEW TESTS NEEDED] We do have any tests on macOS.

Fixes containers#17785

Signed-off-by: Paul Holzinger <[email protected]>
When the service is running with trace log level it wraps the
`http.ResponseWriter` to log extra information. The problem is that the
new type does not keep all the functions from the embedded type.
Instead we have to implement them ourselves, however only Write() was
implemented. Thus `Hijack()`could not be called on the writer. To
prevent these issues we would implement all the interfaces that the
inner type supports (Header, WriteHeader, Flush, Hijack).

Fixes containers#17749

Signed-off-by: Paul Holzinger <[email protected]>
The test should make sure the logs --follow call will log entries that
are created in the future when --since is used and doe not include the
container start event. However it seems the timing is to tight. I think
it was possible that CI logged the line before the logs call was made,
thus it is missing because --since excluded it.

I cannot reproduce so I am not 100% on this but we can reopen the issue
if it still happens.

Fixes containers#17616

Signed-off-by: Paul Holzinger <[email protected]>
If the name already exists and CheckDuplicate is set we need to return
409, if CheckDuplicate is not set we return the network without error.

Fixes containers#17585

Signed-off-by: Paul Holzinger <[email protected]>
Since commit 0624107 we use the aardvark per container dns
functionality. This means we should only have the aardvark ip in
resolv.conf otherwise the client resolver could skip aardvark, thus
ignoring the special dns option for this container.

Fixes containers#17499

Signed-off-by: Paul Holzinger <[email protected]>
This was added as hack in commit 6b06e9b because the journald logs
code was not able to handle an empty journal. But since commit
767947a this is no longer the case, we correctly use the sd_journal
API and know when the journal is empty.

Therefore we no longer need this hack and it should be removed because
it just adds overhead and an empty journal entry for no good reason.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <[email protected]>
The passthrough driver is designed for use in systemd units. By default
we can expect systemd to log the output on journald unless the unit sets
differen StandardOutput/StandardError settings.

At the moment podman logs just errors out when the passthrough driver is
used. With this change we will read the journald for the unit messages.
The logic is actually very similar to the existing one, we just need to
change the filter. We now filter by SYSTEMD_UNIT wich equals to the
contianer cgroup, this allows us the actually filter on a per contianer
basis even when multiple contianers are started in the same unit, i.e.
via [email protected].

The only difference a user will see is that journald will merge
stdout/err into one stream so we loose the separation there.

Signed-off-by: Paul Holzinger <[email protected]>
It makes little sense to create a log line string from the entry just to
parse it again into a LogLine. We have the typed fields so we can
assemble the logLine direclty, this makes things simpler and more
efficient.

Also entries from the passthrough driver do not use the CONTAINER_ID_FULL
field, instead we can just access c.ID() directly.

Signed-off-by: Paul Holzinger <[email protected]>
When run with --cgroups=split mode (e.g. quadlet) we do not use the a
separate cgroup for the container and just run in the unit cgroup.
When we filter logs we thus must match the unit name.
Added a small test to the quadlet test to make sure it will work.

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Mar 16, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2023
@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2023
@openshift-merge-robot openshift-merge-robot merged commit 5106bbf into containers:v4.4 Mar 16, 2023
@Luap99 Luap99 deleted the 4.4-backports branch March 16, 2023 19:47
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants