Skip to content

Commit f25bbc9

Browse files
committed
Fix knative-extensions#626 Do no affect Redis Config nor TLS Config if they are nil
1 parent 4fd4e47 commit f25bbc9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pkg/sink/reconciler/streamsink/streamsink.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ func (r *Reconciler) updateTLSSecret(ctx context.Context, secret *corev1.Secret)
9595
tlsSecret, err := GetTLSSecret(secret.Data)
9696
if err != nil {
9797
logging.FromContext(ctx).Errorw("Error reading TLS configuration", zap.Error(err))
98+
} else {
99+
// For now just override the previous config.
100+
r.tlsCert = tlsSecret.TLSCertificate
98101
}
99-
// For now just override the previous config.
100-
r.tlsCert = tlsSecret.TLSCertificate
101102
}

pkg/source/reconciler/streamsource/streamsource.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,18 @@ func (r *Reconciler) updateRedisConfig(ctx context.Context, configMap *corev1.Co
127127
redisConfig, err := GetRedisConfig(configMap.Data)
128128
if err != nil {
129129
logging.FromContext(ctx).Errorw("Error reading Redis configuration", zap.Error(err))
130+
} else {
131+
// For now just override the previous config.
132+
r.numConsumers = redisConfig.NumConsumers
130133
}
131-
// For now just override the previous config.
132-
r.numConsumers = redisConfig.NumConsumers
133134
}
134135

135136
func (r *Reconciler) updateTLSSecret(ctx context.Context, secret *corev1.Secret) {
136137
tlsSecret, err := GetTLSSecret(secret.Data)
137138
if err != nil {
138139
logging.FromContext(ctx).Errorw("Error reading TLS configuration", zap.Error(err))
140+
} else {
141+
// For now just override the previous config.
142+
r.tlsCert = tlsSecret.TLSCertificate
139143
}
140-
// For now just override the previous config.
141-
r.tlsCert = tlsSecret.TLSCertificate
142144
}

0 commit comments

Comments
 (0)