Closed gid0 closed 2 years ago
As the command implies, there's a git command being ran outside of a git repo. Thanks to your investigation it appears to be:
To fix this we can add the --global
flag to the command. The git command will succeed when run outside a git dir.
I also think this setting, skip_ssl_verification
does not really skip ssl verification at all since it's called after the repo is already cloned.
https://github.com/concourse/semver-resource/blob/b820c58b603ad51f23db3cf15b8ab30475171c6c/driver/git.go#L123-L131
This patch may fix the issue. I don't have time to test right now. If someone wants to test and PR this we'd really appreciate it!
diff --git a/driver/git.go b/driver/git.go
index db9c3cf..ff4e7d9 100644
--- a/driver/git.go
+++ b/driver/git.go
@@ -120,12 +120,12 @@ func (driver *GitDriver) Check(cursor *semver.Version) ([]semver.Version, error)
return nil, err
}
- err = driver.setUpRepo()
+ err = driver.skipSSLVerificationIfNeeded()
if err != nil {
return nil, err
}
- err = driver.skipSSLVerificationIfNeeded()
+ err = driver.setUpRepo()
if err != nil {
return nil, err
}
@@ -182,7 +182,7 @@ func (driver *GitDriver) setUpRepo() error {
func (driver *GitDriver) skipSSLVerificationIfNeeded() error {
if driver.SkipSSLVerification {
- gitSkipSSLVerification := exec.Command("git", "config", "http.sslVerify", "'false'")
+ gitSkipSSLVerification := exec.Command("git", "config", "--gobal", "http.sslVerify", "'false'")
gitSkipSSLVerification.Stdout = os.Stderr
gitSkipSSLVerification.Stderr = os.Stderr
if err := gitSkipSSLVerification.Run(); err != nil {
Hello,
Our users were using this kind of resource definition with the v1.0.2 release :
When we switched to the v1.1.1 release of the resource type with Concourse 5.7.0, we started seeing this kind of failure on all the semver resources :
I tracked the culprit to be "skip_ssl_verification: true" : by removing it from the resource source, resources start working again.
I know that this flag has no meaning when using git over ssh but the resources were previously working with v1.0.2. I tried with v1.1.0 and they were failing too. This flag should be ignored when using git over ssh.