@@ -173,7 +173,7 @@ func newIngressController(config *Configuration) *GenericController {
173
173
DeleteFunc : func (obj interface {}) {
174
174
delIng := obj .(* extensions.Ingress )
175
175
if ! IsValidClass (delIng , config .IngressClass ) {
176
- glog .Infof ("ignoring add for ingress %v based on annotation %v" , delIng .Name , ingressClassKey )
176
+ glog .Infof ("ignoring delete for ingress %v based on annotation %v" , delIng .Name , ingressClassKey )
177
177
return
178
178
}
179
179
ic .recorder .Eventf (delIng , api .EventTypeNormal , "DELETE" , fmt .Sprintf ("Ingress %s/%s" , delIng .Namespace , delIng .Name ))
@@ -182,7 +182,7 @@ func newIngressController(config *Configuration) *GenericController {
182
182
UpdateFunc : func (old , cur interface {}) {
183
183
oldIng := old .(* extensions.Ingress )
184
184
curIng := cur .(* extensions.Ingress )
185
- if ! IsValidClass (curIng , config .IngressClass ) {
185
+ if ! IsValidClass (curIng , config .IngressClass ) && ! IsValidClass ( oldIng , config . IngressClass ) {
186
186
return
187
187
}
188
188
@@ -564,6 +564,10 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
564
564
for _ , ingIf := range ings {
565
565
ing := ingIf .(* extensions.Ingress )
566
566
567
+ if ! IsValidClass (ing , ic .cfg .IngressClass ) {
568
+ continue
569
+ }
570
+
567
571
anns := ic .annotations .Extract (ing )
568
572
569
573
for _ , rule := range ing .Spec .Rules {
@@ -698,6 +702,10 @@ func (ic *GenericController) createUpstreams(data []interface{}) map[string]*ing
698
702
for _ , ingIf := range data {
699
703
ing := ingIf .(* extensions.Ingress )
700
704
705
+ if ! IsValidClass (ing , ic .cfg .IngressClass ) {
706
+ continue
707
+ }
708
+
701
709
secUpstream := ic .annotations .SecureUpstream (ing )
702
710
hz := ic .annotations .HealthCheck (ing )
703
711
@@ -840,6 +848,10 @@ func (ic *GenericController) createServers(data []interface{}, upstreams map[str
840
848
// initialize all the servers
841
849
for _ , ingIf := range data {
842
850
ing := ingIf .(* extensions.Ingress )
851
+ if ! IsValidClass (ing , ic .cfg .IngressClass ) {
852
+ continue
853
+ }
854
+
843
855
// check if ssl passthrough is configured
844
856
sslpt := ic .annotations .SSLPassthrough (ing )
845
857
@@ -868,6 +880,9 @@ func (ic *GenericController) createServers(data []interface{}, upstreams map[str
868
880
// configure default location and SSL
869
881
for _ , ingIf := range data {
870
882
ing := ingIf .(* extensions.Ingress )
883
+ if ! IsValidClass (ing , ic .cfg .IngressClass ) {
884
+ continue
885
+ }
871
886
872
887
for _ , rule := range ing .Spec .Rules {
873
888
host := rule .Host
0 commit comments