[aap_containerized] Refactor plugin to use container-helper APIs - #4450
Open
snagoor wants to merge 2 commits into
Open
[aap_containerized] Refactor plugin to use container-helper APIs#4450snagoor wants to merge 2 commits into
snagoor wants to merge 2 commits into
Conversation
Signed-off-by: Nagoor Shaik <nshaik@redhat.com>
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
Contributor
Author
|
This PR depends on #4446 |
pmoravec
reviewed
Aug 14, 2026
pmoravec
reviewed
Aug 14, 2026
pmoravec
reviewed
Aug 14, 2026
pmoravec
reviewed
Aug 14, 2026
pmoravec
reviewed
Aug 14, 2026
snagoor
force-pushed
the
refactor/aap-containerized-plugin
branch
from
August 14, 2026 13:27
f4ccd43 to
e204649
Compare
pmoravec
reviewed
Aug 14, 2026
| return [] | ||
| return [ | ||
| con[1] | ||
| for con in self.get_containers_by_user(username, get_all=True) |
Contributor
There was a problem hiding this comment.
pylint raises error here due to missing get_containers_by_user method - that is fine, since this PR relies on the other one that adds the method.
Contributor
Author
There was a problem hiding this comment.
Yes, once the PR #4446 is merged, I will rebase it so the pylint can run without any errors.
pmoravec
reviewed
Aug 14, 2026
Comment on lines
+283
to
+284
| if not getattr(self, 'aap_directory_name', None): | ||
| return |
Contributor
There was a problem hiding this comment.
we might add an explanation for skipping the obfuscation, but thta is rather a nitpick.
Contributor
Author
There was a problem hiding this comment.
Done. Added explanation.
pmoravec
approved these changes
Aug 14, 2026
Signed-off-by: Nagoor Shaik <nshaik@redhat.com> Assisted-by: Claude Code
snagoor
force-pushed
the
refactor/aap-containerized-plugin
branch
from
August 14, 2026 17:59
e204649 to
49b841e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4449
Summary
Replaces all manual
su - <user> -c 'podman ...'shell constructions in theaap_containerizedplugin with the typed runtime helpers introduced infeature/container-helpers.Changes
Container discovery
_get_aap_container_names()now delegates toget_containers_by_user(username, get_all=True)instead of shelling out topodman ps --format {{.Names}}.Log collection
log_linesplugin option (default 1000).add_podman_logs()passes it toadd_container_logs(..., runas=username, log_lines=N);--all-logssets it toNone(unbounded) as expected.Inspect and exec
add_podman_inspect()andadd_podman_exec()wrap_runtime.inspect_command()and_runtime.exec_command()withrunas=username, replacing the manualpodman inspect/podman exec -it ... bash -c "..."shell strings.Runtime info commands
setup()calls_runtime.info_command(run_debug=True)and_runtime.list_command(get_all=True)instead of hardcodedpodman info --debug/podman ps -a --format jsonstrings.Username and directory resolution
_get_username(): prefers the plugin option; falls back to scanningps -eo user,argsfor a single user running a rootless podman instance._get_aap_directory(): prefers the plugin option; falls back to~<username>/aapwith a warning log.Forbidden paths
controller/datato cover the entire data directory.SECRET_KEYfile exclusions (subsumed by the above).Test plan
usernameoption — auto-detection logs a warning and identifies the correct user from the process list.-k aap_containerized.username=<user>— inspect, exec, and log output appear under their respective subdirectories (aap_container_logs/,podman_inspect_logs/,podman_cmd_outputs/<container>/).--all-logs— log collection is unbounded (no--tailflag).-k aap_containerized.log_lines=500— logs are tailed to 500 lines per container.controller/dataandeda/etc/*.certare excluded from the archive.