Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow configuring the filepath for the ca from the secret #273

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions e2e/cluster_test.go
Original file line number Diff line number Diff line change
@@ -278,6 +278,7 @@ var _ = Describe("SpiceDBClusters", func() {
"cmd": spicedbCmd,
"tlsSecretName": "spicedb-grpc-tls",
"dispatchUpstreamCASecretName": "spicedb-grpc-tls",
"dispatchUpstreamCAFilePath": "ca.crt",
"serviceAccountName": "spicedb-non-default",
"extraServiceAccountAnnotations": "authzed.com/e2e=true",
"datastoreConnpoolReadMinOpen": 1,
@@ -577,6 +578,7 @@ var _ = Describe("SpiceDBClusters", func() {
"datastoreEngine": "postgres",
"tlsSecretName": "spicedb-grpc-tls",
"dispatchUpstreamCASecretName": "spicedb-grpc-tls",
"dispatchUpstreamCAFilePath": "ca.crt",
}
cluster.Spec.Version = "v1.13.0"

5 changes: 4 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ var (
projectAnnotations = newBoolOrStringKey("projectAnnotations", true)
tlsSecretNameKey = newStringKey("tlsSecretName")
dispatchCAKey = newStringKey("dispatchUpstreamCASecretName")
dispatchCAFilePathKey = newKey("dispatchUpstreamCAFilePath", "tls.crt")
dispatchEnabledKey = newBoolOrStringKey("dispatchEnabled", true)
telemetryCAKey = newStringKey("telemetryCASecretName")
envPrefixKey = newKey("envPrefix", "SPICEDB")
@@ -149,6 +150,7 @@ type SpiceConfig struct {
TLSSecretName string
DispatchEnabled bool
DispatchUpstreamCASecretName string
DispatchUpstreamCASecretPath string
TelemetryTLSCASecretName string
SecretName string
ExtraPodLabels map[string]string
@@ -182,6 +184,7 @@ func NewConfig(cluster *v1alpha1.SpiceDBCluster, globalConfig *OperatorConfig, s
TLSSecretName: tlsSecretNameKey.pop(config),
ServiceAccountName: serviceAccountNameKey.pop(config),
DispatchUpstreamCASecretName: dispatchCAKey.pop(config),
DispatchUpstreamCASecretPath: dispatchCAFilePathKey.pop(config),
TelemetryTLSCASecretName: telemetryCAKey.pop(config),
EnvPrefix: envPrefixKey.pop(config),
SpiceDBCmd: spiceDBCmdKey.pop(config),
@@ -347,7 +350,7 @@ func NewConfig(cluster *v1alpha1.SpiceDBCluster, globalConfig *OperatorConfig, s
}

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

if len(spiceConfig.TelemetryTLSCASecretName) > 0 {
Loading