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

Add support for container initialization #491

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vmsh0
Copy link

@vmsh0 vmsh0 commented Jan 5, 2025

In reference to my issue #490, I have drafted a patch to add support for the operation.

I have performed some trivial manual testing of the change, but trying to run tox results in the log line below repeating indefinitely, and as such I have not run the various testing facilities that the project provides.

If anyone would be able to help me to get the tests running, I would be more than happy to also contribute additional coverage for this new method.

------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------
2025-01-05 18:10:08 [    INFO] Launching(5.3.1) podman --log-level=info system service --time=0 unix:///tmp/tmpqcq78j4c/ad527583baab4ebb96975b65cda25702 refid=1483129501152721076 (utils.py:86)
2025-01-05 18:10:08 [   DEBUG] Starting new HTTP connection (1): localhost:22 (connectionpool.py:241)
2025-01-05 18:10:08 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:08 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:08 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:08 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:09 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:09 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)
2025-01-05 18:10:09 [   DEBUG] Waiting on /run/user/1000/podman/podman-forward-4cad89234a116ac037aa.sock (ssh.py:89)

Copy link
Contributor

openshift-ci bot commented Jan 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vmsh0
Once this PR has been reviewed and has the lgtm label, please assign inknos for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@jwhonce
Copy link
Member

jwhonce commented Jan 7, 2025

@vmsh0 The line
2025-01-05 18:10:08 [ INFO] Launching(5.3.1) podman --log-level=info system service --time=0 unix:///tmp/tmpqcq78j4c/ad527583baab4ebb96975b65cda25702 refid=1483129501152721076 (utils.py:86)
is attempting to start an instance of the podman service for the tests to run against. The Waiting on lines are where the podman-py client is attempting to connect to that instance. What I do not see is why podman failed to start.

@vmsh0
Copy link
Author

vmsh0 commented Jan 10, 2025

The issue is resolved. That log was from the test that uses ssh to loopback the podman socket file to a different location in the filesystem. It simply required suitable ssh and permissions setup.

I have updated my PR to include a unit test and an integration test for the new feature. Also a small docstring fix in a related place.

This commit contributes support for container initialization (i.e., the
operation performed by `podman container init`.)

Alongside that, it introduces:
- unit test ContainersTestCase::test_init
- integration subtest `Create-Init-Start Container` in
  ContainersIntegrationTest::test_container_crud

A small fix to the docstring of Container.status has also been
contributed to reflect the existance of the `created` and `initialized`
states.

Signed-off-by: Riccardo Paolo Bestetti <pbl@bestov.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants