From b2249101f01b800fd5b18ce66e1937322f7f4f27 Mon Sep 17 00:00:00 2001 From: Knative Prow Robot Date: Fri, 10 May 2024 11:13:58 +0100 Subject: [PATCH] Can commit without Password to Redis on Cloud (#576) When we connect to Redis on Cloud, we generally do not need password and username. We can just be done with TLS. So with the If check, we need to pass a dummy username and password, which is anyways not valid but the service starts as the server reject the password and goes ahead with TLS connection. ``` apiVersion: sources.knative.dev/v1alpha1 kind: RedisStreamSource metadata: name: samplesource namespace: user1 spec: address: "rediss://default:password@amaaaaaa74akfsaami2pqxkiosy2gsfsv22fszx77pkb5yj2gemfbqj37lwa-p.redis.us-ashburn-1.oci.oraclecloud.com:6379" stream: teststream sink: ref: apiVersion: serving.knative.dev/v1 kind: Service name: event-display ``` Co-authored-by: Amarendra Kumar --- pkg/source/adapter/adapter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/source/adapter/adapter.go b/pkg/source/adapter/adapter.go index bc75c50f5..2dc34eec2 100644 --- a/pkg/source/adapter/adapter.go +++ b/pkg/source/adapter/adapter.go @@ -237,7 +237,7 @@ func (a *Adapter) newPool(address string) *redis.Pool { // configuring a connection. Dial: func() (redis.Conn, error) { var c redis.Conn - if opt.Password != "" && a.config.TLSCertificate != "" { + if a.config.TLSCertificate != "" { roots := x509.NewCertPool() ok := roots.AppendCertsFromPEM([]byte(a.config.TLSCertificate)) if !ok {