Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Fix duplicate mount path for /etc/pki/ca-trust/extracted/pem (jaegert…
Browse files Browse the repository at this point in the history
…racing#1121)

Signed-off-by: Gary Brown <[email protected]>
  • Loading branch information
objectiser committed Jul 7, 2020
1 parent 55e996a commit 1b82bd2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/config/ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func Update(jaeger *v1.Jaeger, commonSpec *v1.JaegerCommonSpec) {
ReadOnly: true,
}

commonSpec.Volumes = append(commonSpec.Volumes, volume)
commonSpec.VolumeMounts = append(commonSpec.VolumeMounts, volumeMount)
commonSpec.Volumes = util.RemoveDuplicatedVolumes(append(commonSpec.Volumes, volume))
commonSpec.VolumeMounts = util.RemoveDuplicatedVolumeMounts(append(commonSpec.VolumeMounts, volumeMount))
}

func deployTrustedCA(jaeger *v1.Jaeger) bool {
Expand Down
6 changes: 3 additions & 3 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func RemoveDuplicatedVolumes(volumes []corev1.Volume) []corev1.Volume {
return results
}

// removeDuplicatedVolumeMounts returns a unique list based on the item names. Only the first item is kept.
func removeDuplicatedVolumeMounts(volumeMounts []corev1.VolumeMount) []corev1.VolumeMount {
// RemoveDuplicatedVolumeMounts returns a unique list based on the item names. Only the first item is kept.
func RemoveDuplicatedVolumeMounts(volumeMounts []corev1.VolumeMount) []corev1.VolumeMount {
var results []corev1.VolumeMount
existing := map[string]bool{}

Expand Down Expand Up @@ -99,7 +99,7 @@ func Merge(commonSpecs []v1.JaegerCommonSpec) *v1.JaegerCommonSpec {
return &v1.JaegerCommonSpec{
Annotations: annotations,
Labels: labels,
VolumeMounts: removeDuplicatedVolumeMounts(volumeMounts),
VolumeMounts: RemoveDuplicatedVolumeMounts(volumeMounts),
Volumes: RemoveDuplicatedVolumes(volumes),
Resources: *resources,
Affinity: affinity,
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestRemoveDuplicatedVolumeMounts(t *testing.T) {
ReadOnly: true,
}}

assert.Len(t, removeDuplicatedVolumeMounts(volumeMounts), 2)
assert.Len(t, RemoveDuplicatedVolumeMounts(volumeMounts), 2)
assert.Equal(t, "data1", volumeMounts[0].Name)
assert.Equal(t, false, volumeMounts[0].ReadOnly)
assert.Equal(t, "data2", volumeMounts[1].Name)
Expand Down

0 comments on commit 1b82bd2

Please sign in to comment.