Only copy fields being used

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-11-30 20:22:12 -03:00
parent 67808c0ed8
commit f78e2e3849
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -594,7 +594,9 @@ func (s *k8sStore) extractAnnotations(ing *extensions.Ingress) {
key := k8s.MetaNamespaceKey(ing)
glog.V(3).Infof("updating annotations information for ingress %v", key)
copyIng := ing.DeepCopy()
copyIng := &extensions.Ingress{}
ing.ObjectMeta.DeepCopyInto(&copyIng.ObjectMeta)
ing.Spec.DeepCopyInto(&copyIng.Spec)
for ri, rule := range copyIng.Spec.Rules {
if rule.HTTP == nil {
@ -610,7 +612,7 @@ func (s *k8sStore) extractAnnotations(ing *extensions.Ingress) {
err := s.listers.IngressWithAnnotation.Update(&ingress.Ingress{
Ingress: *copyIng,
ParsedAnnotations: s.annotations.Extract(copyIng),
ParsedAnnotations: s.annotations.Extract(ing),
})
if err != nil {
glog.Error(err)