Skip to content

Commit

Permalink
fix(ingress): ingress nil panic
Browse files Browse the repository at this point in the history
Signed-off-by: cndoit18 <cndoit18@outlook.com>
  • Loading branch information
cndoit18 authored and bitsf committed Jul 23, 2021
1 parent cc9952e commit f344706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/controllers/storage/ingress.go
Expand Up @@ -119,12 +119,12 @@ func (m *MinIOController) generateIngress(ctx context.Context, harborcluster *go
annotations := make(map[string]string)
annotations["nginx.ingress.kubernetes.io/proxy-body-size"] = "0"

if harborcluster.Spec.Expose.Core.Ingress.Controller == v1alpha1.IngressControllerNCP {
if harborcluster.Spec.Expose.Core.Ingress != nil && harborcluster.Spec.Expose.Core.Ingress.Controller == v1alpha1.IngressControllerNCP {
annotations["ncp/use-regex"] = NCPIngressValueTrue
if tls != nil {
annotations["ncp/http-redirect"] = NCPIngressValueTrue
}
} else if harborcluster.Spec.Expose.Core.Ingress.Controller == v1alpha1.IngressControllerContour {
} else if harborcluster.Spec.Expose.Core.Ingress != nil && harborcluster.Spec.Expose.Core.Ingress.Controller == v1alpha1.IngressControllerContour {
if tls != nil {
annotations["ingress.kubernetes.io/force-ssl-redirect"] = ContourIngressValueTrue
}
Expand Down

0 comments on commit f344706

Please sign in to comment.