Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change events emit toggle name to --emit-kubernetes-events #5299

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ Adding a new version? You'll need three changes:
[#5128](https://github.com/Kong/kubernetes-ingress-controller/pull/5128)
- Added `-init-cache-sync-duration` CLI flag. This flag configures how long the controller waits for Kubernetes resources to populate at startup before generating the initial Kong configuration. It also fixes a bug that removed the default 5 second wait period.
[#5238](https://github.com/Kong/kubernetes-ingress-controller/pull/5238)
- Added `--emit-translation-events` CLI flag to disable the creation of events
- Added `--emit-kubernetes-events` CLI flag to disable the creation of events
in translating and applying configurations to Kong.
[#5296](https://github.com/Kong/kubernetes-ingress-controller/pull/5296)
[#5299](https://github.com/Kong/kubernetes-ingress-controller/pull/5299)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion docs/cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| `--dump-sensitive-config` | `bool` | Include credentials and TLS secrets in configs exposed with --dump-config flag. | `false` |
| `--election-id` | `string` | Election id to use for status update. | `5b374a9e.konghq.com` |
| `--election-namespace` | `string` | Leader election namespace to use when running outside a cluster. | |
| `--emit-translation-events` | `bool` | Emit Kubernetes events for successful configuration applies, translation failures and configuration apply failures on managed objects. | `true` |
| `--emit-kubernetes-events` | `bool` | Emit Kubernetes events for successful configuration applies, translation failures and configuration apply failures on managed objects. | `true` |
| `--enable-controller-gwapi-gateway` | `bool` | Enable the Gateway API Gateway controller. | `true` |
| `--enable-controller-gwapi-httproute` | `bool` | Enable the Gateway API HTTPRoute controller. | `true` |
| `--enable-controller-gwapi-reference-grant` | `bool` | Enable the Gateway API ReferenceGrant controller. | `true` |
Expand Down
4 changes: 2 additions & 2 deletions internal/manager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type Config struct {
WatchNamespaces []string
GatewayAPIControllerName string
Impersonate string
EmitTranslationEvents bool
EmitKubernetesEvents bool

// Ingress status
PublishServiceUDP OptionalNamespacedName
Expand Down Expand Up @@ -214,7 +214,7 @@ func (c *Config) FlagSet() *pflag.FlagSet {
flagSet.IntVar(&c.Concurrency, "kong-admin-concurrency", 10, "Max number of concurrent requests sent to Kong's Admin API.")
flagSet.StringSliceVar(&c.WatchNamespaces, "watch-namespace", nil,
`Namespace(s) in comma-separated format (or specify this flag multiple times) to watch for Kubernetes resources. Defaults to all namespaces.`)
flagSet.BoolVar(&c.EmitTranslationEvents, "emit-translation-events", true, `Emit Kubernetes events for successful configuration applies, translation failures and configuration apply failures on managed objects.`)
flagSet.BoolVar(&c.EmitKubernetesEvents, "emit-kubernetes-events", true, `Emit Kubernetes events for successful configuration applies, translation failures and configuration apply failures on managed objects.`)

// Ingress status
flagSet.Var(flags.NewValidatedValue(&c.PublishService, namespacedNameFromFlagValue, nnTypeNameOverride), "publish-service",
Expand Down
7 changes: 4 additions & 3 deletions internal/manager/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,12 @@ func Run(

setupLog.Info("Initializing Dataplane Client")
var eventRecorder record.EventRecorder
if c.EmitTranslationEvents {
setupLog.Info("Emit translation event enabled, create event recorder for " + KongClientEventRecorderComponentName)
if c.EmitKubernetesEvents {
setupLog.Info("Emitting Kubernetes events enabled, creating an event recorder for " + KongClientEventRecorderComponentName)
eventRecorder = mgr.GetEventRecorderFor(KongClientEventRecorderComponentName)
} else {
setupLog.Info("Emit translation event disabled, discard all events")
setupLog.Info("Emitting Kubernetes events disabled, discarding all events")
// Create an empty record.FakeRecorder with no Events channel to discard all events.
eventRecorder = &record.FakeRecorder{}
}

Expand Down
Loading