add annotations only if vault is not empty
@@ -668,9 +668,13 @@ func (r *ReconcilePerconaXtraDBCluster) deploy(cr *api.PerconaXtraDBCluster) err
}
haProxySet.Spec.Template.Annotations["percona.com/configuration-hash"] = haProxyConfigHash
if cr.CompareVersionWith("1.5.0") == 0 {
+ if sslHash != "" {
haProxySet.Spec.Template.Annotations["percona.com/ssl-hash"] = sslHash
+ }
+ if sslInternalHash != "" {
haProxySet.Spec.Template.Annotations["percona.com/ssl-internal-hash"] = sslInternalHash
}
+ }
err = r.client.Create(context.TODO(), haProxySet)
if err != nil && !k8serrors.IsAlreadyExists(err) {
return fmt.Errorf("create newStatefulSetHAProxy: %v", err)
@@ -722,9 +726,13 @@ func (r *ReconcilePerconaXtraDBCluster) deploy(cr *api.PerconaXtraDBCluster) err
}
if cr.CompareVersionWith("1.1.0") >= 0 {
proxySet.Spec.Template.Annotations["percona.com/configuration-hash"] = proxyConfigHash
+ if sslHash != "" {
proxySet.Spec.Template.Annotations["percona.com/ssl-hash"] = sslHash
+ }
+ if sslInternalHash != "" {
proxySet.Spec.Template.Annotations["percona.com/ssl-internal-hash"] = sslInternalHash
}
+ }
err = r.client.Create(context.TODO(), proxySet)
if err != nil && !k8serrors.IsAlreadyExists(err) {
