Skip to content

Commit

Permalink
Merge pull request #3713 from jaderhs/fix-tlsterminatedroute-forwardi…
Browse files Browse the repository at this point in the history
…ngmtls-secret-mount-path

Fix TLSTerminatedRoute mtlsCert secret mount path
  • Loading branch information
Brian-McM authored Jan 20, 2025
2 parents c465731 + 8954b24 commit 24424db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/render/manager/manager_route_config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2024-2025 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -446,7 +446,7 @@ func (builder *voltronRouteConfigBuilder) mountSecretReference(name, key string)
builder.mountedSecrets[name] = struct{}{}
}

return fmt.Sprintf("%s/%s/%s", configMapFolder, name, key), nil
return fmt.Sprintf("%s/%s/%s", secretsFolder, name, key), nil
}

// VoltronRouteConfig contains everything needed to configure the voltron pod / container with routes via a mounted file.
Expand Down
8 changes: 4 additions & 4 deletions pkg/render/manager/manager_route_config_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2024-2025 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -248,7 +248,7 @@ var _ = Describe("VoltronRouteConfigBuilder", func() {
"hash.operator.tigera.io/routeconf-s-verylongnametoforceconfli10": "b64f683d0e588b7b03b62f62460efd553df9491e",
"hash.operator.tigera.io/routeconf-s-verylongnametoforceconfli11": "b64f683d0e588b7b03b62f62460efd553df9491e",
"hash.operator.tigera.io/routeconf-cm-ca-bundle-bundle": "ed2e97c745074a9d7ed51a99ea4dfb8b337a3109",
"hash.operator.tigera.io/routeconf-cm-voltron-routes-uitlstermro": "b23457c4614fa00a609dc47aaa630bb8ea54b078",
"hash.operator.tigera.io/routeconf-cm-voltron-routes-uitlstermro": "05f3ffd328b6f86f89a9fb6814b6d2a8d8b12299",
}))
})
})
Expand Down Expand Up @@ -343,7 +343,7 @@ var _ = Describe("VoltronRouteConfigBuilder", func() {
"hash.operator.tigera.io/routeconf-cm-ca-bundle-bundle": "ed2e97c745074a9d7ed51a99ea4dfb8b337a3109",
"hash.operator.tigera.io/routeconf-s-mtls-cert-cert.pem": "e50bc7ce05be499174194858aaf077b556de4d4a",
"hash.operator.tigera.io/routeconf-s-mtls-key-key.pem": "6b519c7eea53167b5fe03c86b7650ada4e7a4784",
routeCMKey: "907bc0d66a81235ae423c36bda0ed50fa73f7f51",
routeCMKey: "89372dff23323c2dc393016ffa370df893ec0dd7",
}))
Expect(config.VolumeMounts()).Should(Equal([]corev1.VolumeMount{caBundleVolumeMount, routesConfigMapVolumeMount, mtlsCertVolumeMount, mtlsKeyVolumeMount}))

Expand All @@ -352,7 +352,7 @@ var _ = Describe("VoltronRouteConfigBuilder", func() {
cm := config.RoutesConfigMap("tigera-manager")
cm.Data[fileName] = compactJSONString(cm.Data[fileName])

routesConfigMap.Data[fileName] = `[{"destination":"","path":"/foobar","caBundlePath":"/config_maps/ca-bundle/ca.bundle","pathRegexp":"^/foobar$","pathReplace":"/","clientCertPath":"/config_maps/mtls-cert/cert.pem","clientKeyPath":"/config_maps/mtls-key/key.pem"}]`
routesConfigMap.Data[fileName] = `[{"destination":"","path":"/foobar","caBundlePath":"/config_maps/ca-bundle/ca.bundle","pathRegexp":"^/foobar$","pathReplace":"/","clientCertPath":"/secrets/mtls-cert/cert.pem","clientKeyPath":"/secrets/mtls-key/key.pem"}]`
Expect(cm).Should(Equal(routesConfigMap))
},
Entry("UI target", operatorv1.TargetTypeUI, "uiTLSTermRoutes.json", "hash.operator.tigera.io/routeconf-cm-voltron-routes-uitlstermro"),
Expand Down

0 comments on commit 24424db

Please sign in to comment.