Check the configmap is valid

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-10 22:45:02 -03:00
parent 75c3c47f81
commit fe2ae8a1ec

View file

@ -891,6 +891,10 @@ func (s *k8sStore) setConfig(cmap *corev1.ConfigMap) {
s.backendConfigMu.Lock() s.backendConfigMu.Lock()
defer s.backendConfigMu.Unlock() defer s.backendConfigMu.Unlock()
if cmap == nil {
return
}
s.backendConfig = ngx_template.ReadConfig(cmap.Data) s.backendConfig = ngx_template.ReadConfig(cmap.Data)
s.writeSSLSessionTicketKey(cmap, "/etc/nginx/tickets.key") s.writeSSLSessionTicketKey(cmap, "/etc/nginx/tickets.key")
} }