@@ -40,11 +40,15 @@ type ingressProbe struct {
4040}
4141
4242func dumpIngress (ingress * v1beta1.Ingress ) string {
43- return fmt .Sprintf ("ingress{Name: %s}" , ingress .GetName () )
43+ return fmt .Sprintf ("ingress{Namespace: %s, Name: %s}" , ingress .Namespace , ingress . Name )
4444}
4545
4646func (p * ingressProbe ) newMetadata (ingress * v1beta1.Ingress ) graph.Metadata {
47- return newMetadata ("ingress" , ingress .Namespace , ingress .GetName (), ingress )
47+ m := newMetadata ("ingress" , ingress .Namespace , ingress .Name , ingress )
48+ m .SetFieldAndNormalize ("Backend" , ingress .Spec .Backend )
49+ m .SetFieldAndNormalize ("TLS" , ingress .Spec .TLS )
50+ m .SetFieldAndNormalize ("Rules" , ingress .Spec .Rules )
51+ return m
4852}
4953
5054func ingressUID (ingress * v1beta1.Ingress ) graph.Identifier {
@@ -66,8 +70,8 @@ func (p *ingressProbe) OnUpdate(oldObj, newObj interface{}) {
6670 p .graph .Lock ()
6771 defer p .graph .Unlock ()
6872
69- if nsNode := p .graph .GetNode (ingressUID (ingress )); nsNode != nil {
70- addMetadata (p .graph , nsNode , ingress )
73+ if ingressNode := p .graph .GetNode (ingressUID (ingress )); ingressNode != nil {
74+ addMetadata (p .graph , ingressNode , ingress )
7175 logging .GetLogger ().Debugf ("Updated %s" , dumpIngress (ingress ))
7276 }
7377 }
@@ -78,8 +82,8 @@ func (p *ingressProbe) OnDelete(obj interface{}) {
7882 p .graph .Lock ()
7983 defer p .graph .Unlock ()
8084
81- if nsNode := p .graph .GetNode (ingressUID (ingress )); nsNode != nil {
82- p .graph .DelNode (nsNode )
85+ if ingressNode := p .graph .GetNode (ingressUID (ingress )); ingressNode != nil {
86+ p .graph .DelNode (ingressNode )
8387 logging .GetLogger ().Debugf ("Deleted %s" , dumpIngress (ingress ))
8488 }
8589 }
0 commit comments