Add flag to skip the update of Ingress status on shutdown

This commit is contained in:
Manuel de Brito Fontes 2017-06-19 21:22:08 -04:00
parent ca5f402322
commit 05a976f9e5
4 changed files with 30 additions and 14 deletions

View file

@ -55,7 +55,10 @@ type Config struct {
Client clientset.Interface
PublishService string
IngressLister store.IngressLister
ElectionID string
ElectionID string
UpdateStatusOnShutdown bool
DefaultIngressClass string
IngressClass string
@ -98,6 +101,11 @@ func (s statusSync) Shutdown() {
return
}
if !s.UpdateStatusOnShutdown {
glog.Warningf("skipping update of status of Ingress rules")
return
}
glog.Infof("updating status of Ingress rules (remove)")
addrs, err := s.runningAddresess()

View file

@ -260,11 +260,12 @@ func TestStatusActions(t *testing.T) {
os.Setenv("POD_NAME", "foo1")
os.Setenv("POD_NAMESPACE", api_v1.NamespaceDefault)
c := Config{
Client: buildSimpleClientSet(),
PublishService: "",
IngressLister: buildIngressListener(),
DefaultIngressClass: "nginx",
IngressClass: "",
Client: buildSimpleClientSet(),
PublishService: "",
IngressLister: buildIngressListener(),
DefaultIngressClass: "nginx",
IngressClass: "",
UpdateStatusOnShutdown: true,
}
// create object
fkSync := NewStatusSyncer(c)