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

fix: use mkdirall when creating ~/.ssh dir to allow for the case where it already exists #2708

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

krancour
Copy link
Member

This fixes a problem that only occurs when using ssh to interact with a remote repo.

We re-setup auth mechanisms every time we load an already-cloned repo from disk because the possibility always exists that for a long-running promotion step, credentials for the repo have been updated between two executions of that step. I am confident this is the right thing to do, however, when using SSH, there is an os.Mkdir() call that can fail because the directory it attempts to create would have been created by the previous execution of the auth setup logic.

This PR solves that problem by using os.MkdirAll() instead, as that will not error if the directory already exists.

Part of #2492

…already exists

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour added this to the v1.0.0 milestone Oct 10, 2024
@krancour krancour self-assigned this Oct 10, 2024
@krancour krancour requested a review from a team as a code owner October 10, 2024 01:49
Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 99477fc
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/670732bda000780008b94a31
😎 Deploy Preview https://deploy-preview-2708--docs-kargo-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 99477fc
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/670732bd786468000981bfde
😎 Deploy Preview https://deploy-preview-2708.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 49.11%. Comparing base (686b0d4) to head (99477fc).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/git/base_repo.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2708   +/-   ##
=======================================
  Coverage   49.11%   49.11%           
=======================================
  Files         270      270           
  Lines       19328    19328           
=======================================
  Hits         9492     9492           
  Misses       9217     9217           
  Partials      619      619           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krancour krancour enabled auto-merge October 10, 2024 02:00
@krancour krancour added this pull request to the merge queue Oct 10, 2024
Merged via the queue into akuity:main with commit 5e0dbac Oct 10, 2024
27 of 28 checks passed
@krancour krancour deleted the krancour/mkdirall branch October 10, 2024 12:38
Marvin9 pushed a commit that referenced this pull request Oct 11, 2024
…e it already exists (#2708)

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants