Add flag to allow switch off the update of Ingress status
This commit is contained in:
parent
7553ab361a
commit
34c42f2869
2 changed files with 13 additions and 5 deletions
|
@ -128,6 +128,8 @@ type Configuration struct {
|
||||||
// Backend is the particular implementation to be used.
|
// Backend is the particular implementation to be used.
|
||||||
// (for instance NGINX)
|
// (for instance NGINX)
|
||||||
Backend ingress.Controller
|
Backend ingress.Controller
|
||||||
|
|
||||||
|
UpdateStatus bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// newIngressController creates an Ingress controller
|
// newIngressController creates an Ingress controller
|
||||||
|
@ -257,11 +259,13 @@ func newIngressController(config *Configuration) *GenericController {
|
||||||
cache.ResourceEventHandlerFuncs{},
|
cache.ResourceEventHandlerFuncs{},
|
||||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||||
|
|
||||||
ic.syncStatus = status.NewStatusSyncer(status.Config{
|
if !config.UpdateStatus {
|
||||||
Client: config.Client,
|
ic.syncStatus = status.NewStatusSyncer(status.Config{
|
||||||
PublishService: ic.cfg.PublishService,
|
Client: config.Client,
|
||||||
IngressLister: ic.ingLister,
|
PublishService: ic.cfg.PublishService,
|
||||||
})
|
IngressLister: ic.ingLister,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
ic.annotations = newAnnotationExtractor(ic)
|
ic.annotations = newAnnotationExtractor(ic)
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,9 @@ func NewIngressController(backend ingress.Controller) *GenericController {
|
||||||
|
|
||||||
defHealthzURL = flags.String("health-check-path", "/healthz", `Defines
|
defHealthzURL = flags.String("health-check-path", "/healthz", `Defines
|
||||||
the URL to be used as health check inside in the default server in NGINX.`)
|
the URL to be used as health check inside in the default server in NGINX.`)
|
||||||
|
|
||||||
|
updateStatus = flags.Bool("update-status", true, `Indicates if the
|
||||||
|
ingress controller should update the Ingress status IP/hostname. Default is true`)
|
||||||
)
|
)
|
||||||
|
|
||||||
flags.AddGoFlagSet(flag.CommandLine)
|
flags.AddGoFlagSet(flag.CommandLine)
|
||||||
|
@ -134,6 +137,7 @@ func NewIngressController(backend ingress.Controller) *GenericController {
|
||||||
os.MkdirAll(ingress.DefaultSSLDirectory, 0655)
|
os.MkdirAll(ingress.DefaultSSLDirectory, 0655)
|
||||||
|
|
||||||
config := &Configuration{
|
config := &Configuration{
|
||||||
|
UpdateStatus: *updateStatus,
|
||||||
Client: kubeClient,
|
Client: kubeClient,
|
||||||
ResyncPeriod: *resyncPeriod,
|
ResyncPeriod: *resyncPeriod,
|
||||||
DefaultService: *defaultSvc,
|
DefaultService: *defaultSvc,
|
||||||
|
|
Loading…
Reference in a new issue