Merge pull request #1758 from aledbf/remove-store

Fix reference to removed lister
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-11-27 19:26:03 -03:00 committed by GitHub
commit 8896412b43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -203,7 +203,7 @@ func (n *NGINXController) syncIngress(item interface{}) error {
PassthroughBackends: passUpstreams, PassthroughBackends: passUpstreams,
} }
if !n.isForceReload() && n.runningConfig != nil && n.runningConfig.Equal(&pcfg) { if !n.isForceReload() && n.runningConfig.Equal(&pcfg) {
glog.V(3).Infof("skipping backend reload (no changes detected)") glog.V(3).Infof("skipping backend reload (no changes detected)")
return nil return nil
} }

View file

@ -117,6 +117,9 @@ func NewNGINXController(config *Configuration, fs file.Filesystem) *NGINXControl
stopLock: &sync.Mutex{}, stopLock: &sync.Mutex{},
fileSystem: fs, fileSystem: fs,
// create an empty configuration.
runningConfig: &ingress.Configuration{},
} }
n.listers, n.controllers = n.createListers(n.stopCh) n.listers, n.controllers = n.createListers(n.stopCh)
@ -220,8 +223,6 @@ type NGINXController struct {
configmap *apiv1.ConfigMap configmap *apiv1.ConfigMap
storeLister *ingress.StoreLister
binary string binary string
resolver []net.IP resolver []net.IP
@ -265,8 +266,6 @@ func (n *NGINXController) Start() {
n.readSecrets(ing) n.readSecrets(ing)
} }
go n.syncQueue.Run(time.Second, n.stopCh)
if n.cfg.EnableSSLChainCompletion { if n.cfg.EnableSSLChainCompletion {
go wait.Until(n.checkSSLChainIssues, 60*time.Second, n.stopCh) go wait.Until(n.checkSSLChainIssues, 60*time.Second, n.stopCh)
} }
@ -290,6 +289,7 @@ func (n *NGINXController) Start() {
glog.Info("starting NGINX process...") glog.Info("starting NGINX process...")
n.start(cmd) n.start(cmd)
go n.syncQueue.Run(time.Second, n.stopCh)
// force initial sync // force initial sync
n.syncQueue.Enqueue(&extensions.Ingress{}) n.syncQueue.Enqueue(&extensions.Ingress{})
@ -565,7 +565,7 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
setHeaders := map[string]string{} setHeaders := map[string]string{}
if cfg.ProxySetHeaders != "" { if cfg.ProxySetHeaders != "" {
cmap, exists, err := n.storeLister.ConfigMap.GetByKey(cfg.ProxySetHeaders) cmap, exists, err := n.listers.ConfigMap.GetByKey(cfg.ProxySetHeaders)
if err != nil { if err != nil {
glog.Warningf("unexpected error reading configmap %v: %v", cfg.ProxySetHeaders, err) glog.Warningf("unexpected error reading configmap %v: %v", cfg.ProxySetHeaders, err)
} }
@ -577,7 +577,7 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
addHeaders := map[string]string{} addHeaders := map[string]string{}
if cfg.AddHeaders != "" { if cfg.AddHeaders != "" {
cmap, exists, err := n.storeLister.ConfigMap.GetByKey(cfg.AddHeaders) cmap, exists, err := n.listers.ConfigMap.GetByKey(cfg.AddHeaders)
if err != nil { if err != nil {
glog.Warningf("unexpected error reading configmap %v: %v", cfg.AddHeaders, err) glog.Warningf("unexpected error reading configmap %v: %v", cfg.AddHeaders, err)
} }
@ -590,7 +590,7 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
sslDHParam := "" sslDHParam := ""
if cfg.SSLDHParam != "" { if cfg.SSLDHParam != "" {
secretName := cfg.SSLDHParam secretName := cfg.SSLDHParam
s, exists, err := n.storeLister.Secret.GetByKey(secretName) s, exists, err := n.listers.Secret.GetByKey(secretName)
if err != nil { if err != nil {
glog.Warningf("unexpected error reading secret %v: %v", secretName, err) glog.Warningf("unexpected error reading secret %v: %v", secretName, err)
} }