Closed benjamin-robertson closed 1 year ago
Less important, but does the fix also need to be made to the unregister function?
Yeah, I was just running a few tests then had to run out.Will complete the merge back to my master branch in a few hours.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Alexander Fisher @.> Sent: Monday, March 7, 2022 10:57:23 PM To: voxpupuli/puppet-gitlab_ci_runner @.> Cc: benjamin-robertson @.>; Author @.> Subject: Re: [voxpupuli/puppet-gitlab_ci_runner] Change to fix issue 144, check for presence of specifed ca_file (#1) (PR #145)
@alexjfisher commented on this pull request.
In lib/puppet/functions/gitlab_ci_runner/register_to_file.rbhttps://github.com/voxpupuli/puppet-gitlab_ci_runner/pull/145#discussion_r820636204:
@@ -41,6 +41,11 @@ def register_to_file(url, regtoken, runner_name, additional_options = {}, proxy return 'DUMMY-NOOP-TOKEN' if Puppet.settings[:noop]
begin
Should probably use Puppet.warning here instead of puts?
The message itself might be better hinting at possibly needing to run Puppet again???
Unable to register gitlab runner at this time as the specified ca_file
does not exist (yet). If puppet is managing this file, the next run should complete the registration process.
???
— Reply to this email directly, view it on GitHubhttps://github.com/voxpupuli/puppet-gitlab_ci_runner/pull/145#pullrequestreview-901592032, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARJBKQKTLNWBRJBRCTM2FFLU6XVKHANCNFSM5QCKM3EA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>
I've added the same check to the unregister. It prevents the errors, and unregisters the runner locally. However does not update the gitlab server since the cert wasn't present. User is provided with a warning as such.
thanks for the PR! I rebased it in https://github.com/voxpupuli/puppet-gitlab_ci_runner/pull/159 and will merge it afterwards.
Pull Request (PR) description
Fixes issue 144 by adding a check to confirm if the ca_file set in the parameters actually exists on the machine.
This problem causes Puppet runs to completely fail when using a Gitlab server with an internally signed CA. Making it impossible to install the ca file with Puppet when the gitlab_ci_runner module is in use.
Added rspec test to check this new condition.
Tests passing in github actions (with the exception of the Ubuntu 18.04 on Puppet 6 which was already failing.).
Docker build . test passing (to the same standard as the existing master branch). Output provided below.
I'm not sure if we should output a message to the user. See register_to_file.rb line 46. Or it should be let to fail silently. Thoughts?
This Pull Request (PR) fixes the following issues
Fixes #144