Skip to content

Commit

Permalink
Merge pull request rancher#19 from StrongMonkey/update-wrangler-http-…
Browse files Browse the repository at this point in the history
…auth

Update wrangler, fix http and ssh auth
  • Loading branch information
ibuildthecloud authored Oct 20, 2020
2 parents b316119 + 731c348 commit 2cc6206
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/imdario/mergo v0.3.9 // indirect
github.com/json-iterator/go v1.1.9 // indirect
github.com/rancher/lasso v0.0.0-20200905045615-7fcb07d6a20b
github.com/rancher/wrangler v0.7.3-0.20201004050240-264809ad4ab9
github.com/rancher/wrangler v0.7.3-0.20201020003736-e86bc912dfac
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.1 // indirect
github.com/urfave/cli v1.22.4
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ github.com/rancher/wrangler v0.7.3-0.20201002224307-4303c423125a h1:rx2kSz+dGj6m
github.com/rancher/wrangler v0.7.3-0.20201002224307-4303c423125a/go.mod h1:goezjesEKwMxHLfltdjg9DW0xWV7txQee6vOuSDqXAI=
github.com/rancher/wrangler v0.7.3-0.20201004050240-264809ad4ab9 h1:JvayfYhLqUHoh+U0QalrjLE0V4Os8JusJW9MVCoeHiM=
github.com/rancher/wrangler v0.7.3-0.20201004050240-264809ad4ab9/go.mod h1:goezjesEKwMxHLfltdjg9DW0xWV7txQee6vOuSDqXAI=
github.com/rancher/wrangler v0.7.3-0.20201019222350-825b41699d6f h1:pJLuHKhStasZ/KftHx4hnVs3THl6SJ19fOkFZvz1Sgs=
github.com/rancher/wrangler v0.7.3-0.20201019222350-825b41699d6f/go.mod h1:goezjesEKwMxHLfltdjg9DW0xWV7txQee6vOuSDqXAI=
github.com/rancher/wrangler v0.7.3-0.20201020003736-e86bc912dfac h1:1mpYb+EPqZ8S95UxMPsQ4tNOPSLrVurAqW5B651chrM=
github.com/rancher/wrangler v0.7.3-0.20201020003736-e86bc912dfac/go.mod h1:goezjesEKwMxHLfltdjg9DW0xWV7txQee6vOuSDqXAI=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
Expand Down
15 changes: 15 additions & 0 deletions pkg/controller/gitjob/gitjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ func (h Handler) generateJob(obj *v1.GitJob) (*batchv1.Job, error) {
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
corev1.Volume{
Name: "tekton-creds",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
)

//setup custom ca
Expand Down Expand Up @@ -303,6 +309,10 @@ func (h Handler) generateCloneContainer(obj *v1.GitJob) (corev1.Container, error
Name: "tekton-internal-home",
MountPath: "/tekton/home",
},
{
Name: "tekton-creds",
MountPath: "/tekton/creds",
},
},
TerminationMessagePath: "/tekton/termination",
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
Expand All @@ -319,6 +329,11 @@ func (h Handler) generateCloneContainer(obj *v1.GitJob) (corev1.Container, error
return corev1.Container{}, err
}

//tekton requires https:// to be prefixed on hostname https://github.com/tektoncd/pipeline/issues/2409
if secretType == "basic" {
hostname = "https://" + hostname
}

c.Args = append([]string{fmt.Sprintf("-%s-git=%s=%s", secretType, obj.Spec.Git.ClientSecretName, hostname)}, c.Args...)
c.VolumeMounts = append(c.VolumeMounts, corev1.VolumeMount{
MountPath: fmt.Sprintf("/tekton/creds-secrets/%s", obj.Spec.Git.ClientSecretName),
Expand Down

0 comments on commit 2cc6206

Please sign in to comment.