Fix append to empty slice (#80)

* Fix append to empty slice

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Fix initialization of addresses slice

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
This commit is contained in:
Hussein Galal
2024-01-04 01:49:48 +02:00
committed by GitHub
parent 99d043f2ee
commit fedfa109b5
3 changed files with 2 additions and 5 deletions

View File

@@ -22,7 +22,6 @@ func (s *Server) Ingress(ctx context.Context, client client.Client) (*networking
if err != nil {
return nil, err
}
ingressRules := s.ingressRules(addresses)
ingress := &networkingv1.Ingress{
TypeMeta: metav1.TypeMeta{
@@ -47,7 +46,6 @@ func (s *Server) Ingress(ctx context.Context, client client.Client) (*networking
func (s *Server) ingressRules(addresses []string) []networkingv1.IngressRule {
var ingressRules []networkingv1.IngressRule
pathTypePrefix := networkingv1.PathTypePrefix
for _, address := range addresses {
rule := networkingv1.IngressRule{
Host: s.cluster.Name + "." + address + wildcardDNS,

View File

@@ -212,7 +212,7 @@ func (s *Server) StatefulServer(ctx context.Context, cluster *v1alpha1.Cluster)
replicas = *cluster.Spec.Servers
if cluster.Spec.Persistence.Type != EphermalNodesType {
if cluster.Spec.Persistence != nil && cluster.Spec.Persistence.Type != EphermalNodesType {
persistent = true
pvClaims = []v1.PersistentVolumeClaim{
{