Skip to content

Commit c4db624

Browse files
authored
Merge pull request #273 from authzed/capath
allow configuring the filepath for the ca from the secret
2 parents b20aeb9 + c94d78b commit c4db624

File tree

3 files changed

+244
-218
lines changed

3 files changed

+244
-218
lines changed

e2e/cluster_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ var _ = Describe("SpiceDBClusters", func() {
278278
"cmd": spicedbCmd,
279279
"tlsSecretName": "spicedb-grpc-tls",
280280
"dispatchUpstreamCASecretName": "spicedb-grpc-tls",
281+
"dispatchUpstreamCAFilePath": "ca.crt",
281282
"serviceAccountName": "spicedb-non-default",
282283
"extraServiceAccountAnnotations": "authzed.com/e2e=true",
283284
"datastoreConnpoolReadMinOpen": 1,
@@ -577,6 +578,7 @@ var _ = Describe("SpiceDBClusters", func() {
577578
"datastoreEngine": "postgres",
578579
"tlsSecretName": "spicedb-grpc-tls",
579580
"dispatchUpstreamCASecretName": "spicedb-grpc-tls",
581+
"dispatchUpstreamCAFilePath": "ca.crt",
580582
}
581583
cluster.Spec.Version = "v1.13.0"
582584

pkg/config/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var (
6060
projectAnnotations = newBoolOrStringKey("projectAnnotations", true)
6161
tlsSecretNameKey = newStringKey("tlsSecretName")
6262
dispatchCAKey = newStringKey("dispatchUpstreamCASecretName")
63+
dispatchCAFilePathKey = newKey("dispatchUpstreamCAFilePath", "tls.crt")
6364
dispatchEnabledKey = newBoolOrStringKey("dispatchEnabled", true)
6465
telemetryCAKey = newStringKey("telemetryCASecretName")
6566
envPrefixKey = newKey("envPrefix", "SPICEDB")
@@ -149,6 +150,7 @@ type SpiceConfig struct {
149150
TLSSecretName string
150151
DispatchEnabled bool
151152
DispatchUpstreamCASecretName string
153+
DispatchUpstreamCASecretPath string
152154
TelemetryTLSCASecretName string
153155
SecretName string
154156
ExtraPodLabels map[string]string
@@ -182,6 +184,7 @@ func NewConfig(cluster *v1alpha1.SpiceDBCluster, globalConfig *OperatorConfig, s
182184
TLSSecretName: tlsSecretNameKey.pop(config),
183185
ServiceAccountName: serviceAccountNameKey.pop(config),
184186
DispatchUpstreamCASecretName: dispatchCAKey.pop(config),
187+
DispatchUpstreamCASecretPath: dispatchCAFilePathKey.pop(config),
185188
TelemetryTLSCASecretName: telemetryCAKey.pop(config),
186189
EnvPrefix: envPrefixKey.pop(config),
187190
SpiceDBCmd: spiceDBCmdKey.pop(config),
@@ -347,7 +350,7 @@ func NewConfig(cluster *v1alpha1.SpiceDBCluster, globalConfig *OperatorConfig, s
347350
}
348351

349352
if len(spiceConfig.DispatchUpstreamCASecretName) > 0 && spiceConfig.DispatchEnabled {
350-
passthroughConfig["dispatchUpstreamCAPath"] = "/dispatch-tls/tls.crt"
353+
passthroughConfig["dispatchUpstreamCAPath"] = "/dispatch-tls/" + spiceConfig.DispatchUpstreamCASecretPath
351354
}
352355

353356
if len(spiceConfig.TelemetryTLSCASecretName) > 0 {

0 commit comments

Comments
 (0)