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

feat: add support for ssh property in the build command #1058

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

banditopazzo
Copy link
Contributor

@banditopazzo banditopazzo force-pushed the 705-ssh-key-support-in-build branch 2 times, most recently from 8b3cf3d to de03e45 Compare October 12, 2024 19:38
"test_build_ssh_map",
"test_build_ssh_array",
])

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would make sense to produce some output that shows that information was really acquired from the agent and then assert it in the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you mean not having the mock agent at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, got it, I found a solution to check the key

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for not being explicit, but your solution was pretty similar to what I was thinking about.

A more simplier solution would be to do:

RUN echo "No id:" >> /result.log 
RUN --mount=type=ssh ssh-add -L >> /result.log

RUN echo "id1:" >> /result.log 
RUN --mount=type=ssh,id=id1 ssh-add -L >> /result.log

RUN echo "id2:" >> /result.log 
RUN --mount=type=ssh,id=id2 ssh-add -L >> /result.log

Then in docker compose set command to cat /result.log and then check the logs in the test via podman compose logs (there are a few tests that do this to use for reference).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

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

This PR is great, thank you! I had a couple of suggestions for the test, but overall looks great.

@p12tic
Copy link
Collaborator

p12tic commented Oct 14, 2024

Could you please combine the commits into one and remove feat: prefix as we don't use them in this repository? Thanks!

Fixes containers#705: Add support for ssh property in the build command

Signed-off-by: Domenico Salvatore <[email protected]>
@p12tic p12tic merged commit a3fb4b3 into containers:main Oct 15, 2024
7 checks passed
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.

Support ssh key in building images
2 participants