Skip to content

Commit

Permalink
TLS fix for Postgres (#1276)
Browse files Browse the repository at this point in the history
/chery-pick

Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto authored Apr 8, 2024
1 parent cb5dd76 commit e5a0d51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ func (opt *postgresOptions) setDatabaseCredentials(appBinding *appcatalog.AppBin
}

userName := ""

if _, ok := appBindingSecret.Data[core.TLSPrivateKeyKey]; ok {
if appBinding.Spec.TLSSecret != nil && appBinding.Spec.TLSSecret.Name != "" {
appBindingSecret, err = opt.kubeClient.CoreV1().Secrets(appBinding.Namespace).Get(context.TODO(), appBinding.Spec.TLSSecret.Name, metav1.GetOptions{})
if err != nil {
return err
}
certByte, ok := appBindingSecret.Data[core.TLSCertKey]
if !ok {
return fmt.Errorf("can't find client cert")
Expand Down

0 comments on commit e5a0d51

Please sign in to comment.