Skip to content

Commit

Permalink
fix: re-implement status update flags (#1514)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shaneutt authored Jul 8, 2021
1 parent cb12ad9 commit 4125d78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion railgun/manager/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,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{
Expand Down
4 changes: 4 additions & 0 deletions railgun/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Config struct {
// Ingress status
PublishService string
PublishStatusAddress []string
UpdateStatus bool

// Kubernetes API toggling
IngressExtV1beta1Enabled util.EnablementStatus
Expand Down Expand Up @@ -150,6 +151,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)
Expand Down Expand Up @@ -189,6 +192,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
}
Expand Down

0 comments on commit 4125d78

Please sign in to comment.