-
Notifications
You must be signed in to change notification settings - Fork 361
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
Modify volume mount behavior when source does not exist #1408
base: devel
Are you sure you want to change the base?
Conversation
ansible-runner will ignore adding the mountpoint to the '-v` argument list if the source path does not exist. Instead it should respect whatever the user is passing to the '--container-volume-mount' option. The exception would be if the user tried to pass a file as the source path; ansible-runner should resolve the file's parent directory.
I'm not entirely sure what to do about the failing unit tests. Please advise. |
I had to research this behavior a bit, but it appears that
Given the differing behavior, I'm not in favor of this change as it is since it would suddenly cause users who may be using podman to get unexpected errors during a different/later phase of |
@demonpig After some discussion with others around this, I'm starting to come around to the idea of just keeping this as-is and letting the container engine do whatever it's going to do. I haven't had a chance to explore your unit test failures, but you should check how your changes affect the output that is expected when comparing the generated |
@Shrews Thanks for the updates. I'll take a look at them and see what I can do to fix them. |
Howdy! Was wondering if anyone could share their opinions on how to approach the failing tests. My initial thoughts are to redo them in order to get them to pass. I have been trying to figure out how to change the code within the I'm trying to find balance between the following items:
Any thoughts / ideas would be appreciated. |
I believe a fair amount of tests will probably need to be updated, as they were expecting missing paths to be removed. I haven't evaluated the changes after line 400. Do we need those extra changes? Or is it sufficient enough to just not return early? |
I'll check right now. |
Ok, I've checked and basically all of the other "is this a dir" and such fail, and we modify things we shouldn't be. Because we assume if it's not a dir, it's a file and need to do I'm thinking we need to wrap all of the manipulations in 'if os.path.exists:`. And just skip all of the path manipulations if the file doesn't. Although this is imprecise. I think what we really need to know is whether we are running in a streaming setup, and skip all of the manipulations then. Otherwise we're making a lot of assumptions that can be wrong, because we don't know the operating intent. However, I don't believe the config knows anything about whether it is operating in this manner. I'm kind of "talking out loud" because I'm not sure how to make this do what it really needs in the scenarios it needs them. |
So "it works" but not to what I was expecting. The
Translated podman command:
|
After "talking" that through, I feel like some changes being made in #1397 could help, but I'm wondering if we move That would then let us know we are in streaming mode, and could then skip path checking and manipulation. |
@sivel Sounds good. I'm not too familiar with #1397 but if that is the easier route to go, then I'm all for it. Essentially, I think the only way to fix the issue with the containerized offering of AAP is to fix this one issue. I was able to trace the issue down to |
We're talking this over more. We'll try to get back to you soon. |
Ok, so bear with me here as I brain dump some things I found. I mapped out the surface area of the impact of this change (calls to the
I'm of the opinion that trying to modify a function that is so totally broken, and does so many things wrong, is going to be pointless to attempt. I'm leaning towards just directly adding the mounts at the call point for this method for the container volume mounts (i.e., inside Anyone else have thoughts about that suggestion? |
Inside |
This reverts commit 601527d.
Reverted my original changes and adjusted the |
I feel like this current iteration might be the way to go, albeit some tests need adjusting, but I also feel it is significant enough of a change that we need to have a porting guide entry for it. The porting guide is being added in PR #1397, so it would need to be committed after that one. We'd also want to consult with the Controller team on the changes since these differences are not insignificant. Some potential things we'd might want to mention in the guide, and to be considered in the interaction with Controller, and across the board:
AIUI, the first point is your main reasoning for the change, but it's the implications of the other points that we should think about a bit. The main thing we don't want to do is break anything in Controller. |
@Shrews Did you want the tests updated within this PR or in another? |
Probably not much point in updating tests yet until we know for sure if this change negatively affects Controller or not. |
ansible-runner will ignore adding the mountpoint to the '-v` argument list if the source path does not exist. Instead it should respect whatever the user is passing to the '--container-volume-mount' option. The exception would be if the user tried to pass a file as the source path; ansible-runner should resolve the file's parent directory.