Merge pull request #1074 from aledbf/rem-lua

Remove lua and use fastcgi to render errors
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-08-07 22:15:32 -04:00 committed by GitHub
commit cf732e846e
36 changed files with 259 additions and 4178 deletions

View file

@ -110,6 +110,8 @@ type GenericController struct {
// runningConfig contains the running configuration in the Backend
runningConfig *ingress.Configuration
forceReload bool
}
// Configuration contains all the settings required by an Ingress controller
@ -230,7 +232,9 @@ func newIngressController(config *Configuration) *GenericController {
ic.syncQueue.Enqueue(obj)
},
UpdateFunc: func(old, cur interface{}) {
if !reflect.DeepEqual(old, cur) {
oep := old.(*api.Endpoints)
ocur := cur.(*api.Endpoints)
if !reflect.DeepEqual(ocur.Subsets, oep.Subsets) {
ic.syncQueue.Enqueue(cur)
}
},
@ -243,6 +247,7 @@ func newIngressController(config *Configuration) *GenericController {
if mapKey == ic.cfg.ConfigMapName {
glog.V(2).Infof("adding configmap %v to backend", mapKey)
ic.cfg.Backend.SetConfig(upCmap)
ic.forceReload = true
}
},
UpdateFunc: func(old, cur interface{}) {
@ -252,6 +257,7 @@ func newIngressController(config *Configuration) *GenericController {
if mapKey == ic.cfg.ConfigMapName {
glog.V(2).Infof("updating configmap backend (%v)", mapKey)
ic.cfg.Backend.SetConfig(upCmap)
ic.forceReload = true
}
// updates to configuration configmaps can trigger an update
if mapKey == ic.cfg.ConfigMapName || mapKey == ic.cfg.TCPConfigMapName || mapKey == ic.cfg.UDPConfigMapName {
@ -405,7 +411,7 @@ func (ic *GenericController) syncIngress(key interface{}) error {
PassthroughBackends: passUpstreams,
}
if ic.runningConfig != nil && ic.runningConfig.Equal(&pcfg) {
if !ic.forceReload && ic.runningConfig != nil && ic.runningConfig.Equal(&pcfg) {
glog.V(3).Infof("skipping backend reload (no changes detected)")
return nil
}
@ -424,6 +430,7 @@ func (ic *GenericController) syncIngress(key interface{}) error {
setSSLExpireTime(servers)
ic.runningConfig = &pcfg
ic.forceReload = false
return nil
}
@ -1255,7 +1262,7 @@ func (ic GenericController) Start() {
runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
}
go ic.syncQueue.Run(10*time.Second, ic.stopCh)
go ic.syncQueue.Run(time.Second, ic.stopCh)
if ic.syncStatus != nil {
go ic.syncStatus.Run(ic.stopCh)