zegl / kube-score

Kubernetes object analysis with recommendations for improved reliability and security. kube-score actively prevents downtime and bugs in your Kubernetes YAML and Charts. Static code analysis for Kubernetes.
https://kube-score.com
MIT License
2.74k stars 176 forks source link

kube-score panic on empty `ingress.spec.rules.http` #388

Closed Nitive closed 3 years ago

Nitive commented 3 years ago

Which version of kube-score are you using?

1.12.0

What did you do?

I'm trying to lint ingress without .spec.rules.http block

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: app-ingress
spec:
  rules:
    - host: foo.bar.network
  tls:
    - hosts:
        - foo.bar.network

What did you expect to see?

No panic. ing.spec.rules.http is not required by spec. We use ingresses without http block for redirects which are specified as annotations.

What did you see instead?

panic: runtime error: invalid memory address or nil pointer dereference