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

Initialize container manager based on whether the ContainerHooksPath is set #2317

Merged

Conversation

nikola-jokic
Copy link
Contributor

@nikola-jokic nikola-jokic commented Dec 16, 2022

When the operation provider is called, it initializes both the dockerManager and the containerHookManager.
The dockerManager will call which on docker, which can cause initialization to fail.

The fix should relax the docker cli dependency if the runner is going to use container hooks.

Related to the issue in runner-container-hooks: actions/runner-container-hooks#30

@nikola-jokic nikola-jokic requested a review from a team as a code owner December 16, 2022 10:38
@@ -111,7 +151,6 @@ private void Setup([CallerMemberName] string testName = "")
_containerHookManager = new Mock<IContainerHookManager>();
containerOperationProvider = new ContainerOperationProvider();

_hc.SetSingleton<IDockerCommandManager>(_dockerManager.Object);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this was set in the first place if never used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I saw another set below which is exactly the same, so it should not influence the execution, right?
Tests are passing and setup is used for them so I guess this is okay

Copy link
Contributor

@fhammerl fhammerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fhammerl fhammerl merged commit 04761e5 into actions:main Dec 16, 2022
@nikola-jokic nikola-jokic deleted the nikola-jokic/dockercli-dependency-cont-hook branch December 16, 2022 14:49
nikola-jokic added a commit to nikola-jokic/runner that referenced this pull request May 12, 2023
…is set (actions#2317)

* Added tests around checking if correct manager's Initialize method has been called

* repaired missing initialization on container action handler
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