Skip to content

Commit 8ad0289

Browse files
authored
TLS fix for Postgres (#1276) (#1284)
/cherry-pick Signed-off-by: souravbiswassanto <saurov@appscode.com>
1 parent c52291e commit 8ad0289

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/util.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ func (opt *postgresOptions) setDatabaseCredentials(appBinding *appcatalog.AppBin
114114
}
115115

116116
userName := ""
117-
118-
if _, ok := appBindingSecret.Data[core.TLSPrivateKeyKey]; ok {
117+
if appBinding.Spec.TLSSecret != nil && appBinding.Spec.TLSSecret.Name != "" {
118+
appBindingSecret, err = opt.kubeClient.CoreV1().Secrets(appBinding.Namespace).Get(context.TODO(), appBinding.Spec.TLSSecret.Name, metav1.GetOptions{})
119+
if err != nil {
120+
return err
121+
}
119122
certByte, ok := appBindingSecret.Data[core.TLSCertKey]
120123
if !ok {
121124
return fmt.Errorf("can't find client cert")

0 commit comments

Comments
 (0)