fix(plugins/container): use an unique ctx for fetcher.#758
fix(plugins/container): use an unique ctx for fetcher.#758poiana merged 1 commit intofalcosecurity:mainfrom
Conversation
Podman relies upon context to store its connection infos. Using same ctx already used by the real Podman engine means that we are going to tamper with its connection info stored in the main ctx. Instead, fetcher should use its own context. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
|
This was causing: |
| panic("not a copier") | ||
| } | ||
| e, _ := copyEngine.copy(ctx) | ||
| e, _ := copyEngine.copy(f.ctx) |
There was a problem hiding this comment.
In this call, podman will store into ctx its key/value for the connection, see https://github.com/falcosecurity/plugins/blob/main/plugins/container/go-worker/pkg/container/podman.go#L32 (and NewConnection behavior: https://github.com/containers/podman/blob/main/pkg/bindings/connection.go#L139).
From NewConnection doc:
// NewConnectionWithIdentity takes a URI as a string and returns a context with the
// Connection embedded as a value. This context needs to be passed to each
// endpoint to work correctly.
Rules files suggestions |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, leogr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area plugins
What this PR does / why we need it:
Podman relies upon context to store its connection infos. Using same ctx already used by the real Podman engine means that we are going to tamper with its connection info stored in the main ctx.
Instead, fetcher should use its own context.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: