From 5bd076c492cbf0ae3d78df1bda26e1e9f175af24 Mon Sep 17 00:00:00 2001 From: Shane Utt Date: Thu, 8 Jul 2021 10:53:53 -0400 Subject: [PATCH] fix: re-implement status update flags This patch re-implements the --status-update flag for KIC 2.0 but also deprecates the --update-status-on-shutdown flag as the behavior of tearing down on cleanup is somewhat in conflict with the idempontent and eventually consistent design of KIC 2.0. --- CHANGELOG.md | 4 ++++ railgun/manager/run.go | 7 ++++++- railgun/pkg/config/config.go | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34ddf034c..23a867eb17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ - The historical `--stderrthreshold` flag is now deprecated: it no longer has any effect when used and will be removed in a later release. [#1297](https://github.com/Kong/kubernetes-ingress-controller/issues/1297) +- The `--update-status-on-shutdown` flag which supplements the `--update-status` + flag has been deprecated and will no longer have any effect, it will be removed + in a later release. + [#1304](https://github.com/Kong/kubernetes-ingress-controller/issues/1304) ## [2.0.0-alpha.2] - 2021/07/07 diff --git a/railgun/manager/run.go b/railgun/manager/run.go index caed7b71f6..e295589e84 100644 --- a/railgun/manager/run.go +++ b/railgun/manager/run.go @@ -168,7 +168,12 @@ func Run(ctx context.Context, c *config.Config) error { return err } - go ctrlutils.PullConfigUpdate(ctx, kongConfig, logger, kubeconfig, c.PublishService, c.PublishStatusAddress) + if c.UpdateStatus { + setupLog.Info("status updates enabled, status update routine is being started in the background.") + go ctrlutils.PullConfigUpdate(ctx, kongConfig, logger, kubeconfig, c.PublishService, c.PublishStatusAddress) + } else { + setupLog.Info("WARNING: status updates were disabled, resources like Ingress objects will not receive updates to their statuses.") + } alwaysEnabled := util.EnablementStatusEnabled controllers := []ControllerDef{ diff --git a/railgun/pkg/config/config.go b/railgun/pkg/config/config.go index 3576aa26ec..54d3dc5962 100644 --- a/railgun/pkg/config/config.go +++ b/railgun/pkg/config/config.go @@ -61,6 +61,7 @@ type Config struct { // Ingress status PublishService string PublishStatusAddress []string + UpdateStatus bool // Kubernetes API toggling IngressExtV1beta1Enabled util.EnablementStatus @@ -151,6 +152,8 @@ func (c *Config) FlagSet() *pflag.FlagSet { flagSet.StringSliceVar(&c.PublishStatusAddress, "publish-status-address", []string{}, `User-provided addresses in comma-separated string format, for use in lieu of "publish-service" when that Service lacks useful address information (for example, in bare-metal environments).`) + flagSet.BoolVar(&c.UpdateStatus, "update-status", true, + `Indicates if the ingress controller should update the status of resources (e.g. IP/Hostname for v1.Ingress, e.t.c.)`) // Kubernetes API toggling flagSet.enablementStatusVar(&c.IngressNetV1Enabled, "controller-ingress-networkingv1", util.EnablementStatusEnabled, "Enable or disable the Ingress controller (using API version networking.k8s.io/v1)."+onOffUsage) @@ -190,6 +193,7 @@ func (c *Config) FlagSet() *pflag.FlagSet { proxy.DefaultSyncSeconds, )) flagSet.Int("stderrthreshold", 0, "DEPRECATED: has no effect and will be removed in future releases (see github issue #1297)") + flagSet.Bool("update-status-on-shutdown", false, `DEPRECATED: no longer has any effect and will be removed in a later release (see github issue #1304)`) return &flagSet.FlagSet }