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

chore: Support running dockerized toolchain using sudo #11955

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

jannfis
Copy link
Member

@jannfis jannfis commented Jan 11, 2023

Previously, when a user was not part of the docker group, they had to run the make targets for the dockerized toolchain using sudo in order to leverage Docker. This could have led to lots of fscked up permissions in the source tree.

This small fix for the toolchain adds support for properly using sudo to leverage docker, instead of relying on the user to be member of the (privileged) docker group.

User can now just run: SUDO=sudo make <target> and the Makefile will leverage sudo as appropriate. This also allows to specify to impersonate other users, e.g. by setting SUDO="sudo -u foobar" make <target>

The change also removes a lot of chmod -R 777 from the test container's Dockerfile, which were added as a result of mixed user ids accessing the same set of files. These chmod's were both slow, and insecure.

Signed-off-by: jannfis jann@mistrust.net

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Base: 47.29% // Head: 47.29% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (4b602b5) compared to base (c31d15e).
Patch has no changes to coverable lines.

❗ Current head 4b602b5 differs from pull request most recent head 108f82b. Consider uploading reports for the commit 108f82b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11955      +/-   ##
==========================================
- Coverage   47.29%   47.29%   -0.01%     
==========================================
  Files         245      245              
  Lines       41670    41669       -1     
==========================================
- Hits        19707    19706       -1     
  Misses      19978    19978              
  Partials     1985     1985              
Impacted Files Coverage Δ
server/repository/repository.go 51.50% <0.00%> (-0.13%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jannfis
Copy link
Member Author

jannfis commented Jan 12, 2023

Maybe someone could test this on a mac, please? :)

Signed-off-by: jannfis <jann@mistrust.net>
@jannfis jannfis force-pushed the chore/docker-toolchain-sudo branch from 4b602b5 to 108f82b Compare January 17, 2023 00:59
Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Worked fine on my Mac. Thanks!

@crenshaw-dev crenshaw-dev merged commit 96b0eb0 into argoproj:master Jan 18, 2023
emirot pushed a commit to emirot/argo-cd that referenced this pull request Jan 27, 2023
Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
Signed-off-by: emirot <emirot.nolan@gmail.com>
schakrad pushed a commit to schakrad/argo-cd that referenced this pull request Mar 14, 2023
Signed-off-by: jannfis <jann@mistrust.net>

Signed-off-by: jannfis <jann@mistrust.net>
Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
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