Skip to content

Commit

Permalink
Can commit without Password to Redis on Cloud (#577)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
knative-prow-robot and amarflybot authored May 10, 2024
1 parent ec3a8f3 commit bad4920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/source/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bad4920

Please sign in to comment.