Skip to content

Commit

Permalink
chore: 3.8 breaking changes (#7818)
Browse files Browse the repository at this point in the history
* Add 3.8 breaking changes

Signed-off-by: Diana <[email protected]>

* Add custom plugin migration steps for Redis changes

Signed-off-by: Diana <[email protected]>

* Apply code review feedback

Signed-off-by: Diana <[email protected]>

---------

Signed-off-by: Diana <[email protected]>
  • Loading branch information
cloudjumpercat authored Sep 4, 2024
1 parent ab417fa commit a090b5a
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion app/_src/gateway/breaking-changes/38x.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,49 @@ Review the [changelog](/gateway/changelog/#3800) for all the changes in this rel

## Breaking changes and deprecations

TBA
### `kong.logrotate` configuration file no longer overwritten during upgrade
The `kong.logrotate` configuration file will no longer be overwritten during upgrade.
When upgrading, set the environment variable `DEBIAN_FRONTEND=noninteractive` on Debian/Ubuntu to avoid any interactive prompts and enable fully automatic upgrades.

### `log_statistics` defaults to `false` for AI Proxy
A configuration validation was added to the [AI Proxy plugin](/hub/kong-inc/ai-proxy/) to prevent users from enabling `log_statistics` for
providers that don't support statistics. In addition, the default of `log_statistics` was changed from
`true` to `false`, and a database migration is added as well for disabling `log_statistics` if it
has already been enabled upon unsupported providers.

### Custom plugins that used shared Redis config

In 3.8.0.0, Kong has changed and refactored the shared Redis configuration that previously was imported by `require "kong.enterprise_edition.redis"`. If you created a custom plugin that is using this shared configuration or if you have a forked version of a plugin, like `rate-limiting-advanced`, then you might need to do additional steps before you can upgrade to the new version of this Redis config.

Out of the box, custom plugins should still work since the old shared configuration is still available. The new config adds the `cluster_max_redirections` option for Redis Cluster, and the `cluster_nodes` format and `sentinel_nodes` were changed. Other than that, the initialization step is no longer required.

#### Upgrade custom plugins using a shared Redis config

If your plugin is using a shared Redis config (for example, if you import `require "kong.enterprise_edition.redis"`) you must do the following:

1. Remove the `redis.init_conf(conf)` library initialization call.
Where `redis` is `local redis = require "kong.enterprise_edition.redis"`.
1. Switch the imports of redis from `local redis = require "kong.enterprise_edition.redis"` to `local redis = require "kong.enterprise_edition.tools.redis.v2"`.

#### Upgrade custom plugins using the rate limiting library

If your plugin is using rate limiting library (as in you import `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name")`) you must switch the imports of the following:

* **Shared Redis config:** Change `local redis = require "kong.enterprise_edition.redis"` to `local redis = require "kong.enterprise_edition.tools.redis.v2"`
* **Rate limiting library:** Change `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name")` to `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name", { redis_config_version = "v2" })`

### Deprecations

#### `sentinel_addresses` and `cluster_addresses` for Redis

The following plugins switched `cluster_addresses` to `cluster_nodes` and `sentinel_addresses` to `sentinel_nodes` for Redis configuration:

* [AI Rate Limiting Advanced](/hub/kong-inc/ai-rate-limiting-advanced/)
* [GraphQL Proxy Caching Advanced](/hub/kong-inc/graphql-proxy-cache-advanced/)
* [GraphQL Rate Limiting Advanced](/hub/kong-inc/graphql-rate-limiting-advanced/)
* [Proxy Caching Advanced](/hub/kong-inc/proxy-cache-advanced/)
* [Rate Limiting Advanced](/hub/kong-inc/rate-limiting-advanced/)

These fields are converted automatically when you run `kong migrations up`. Also, any changes uploaded via decK or the Admin API using the old `cluster_addresses` and `sentinel_addresses` are respected and properly translated to the new fields.

Forked custom plugins aren't automatically migrated. For more information about how to migrate custom plugins, see [Custom plugins that used shared Redis config](#custom-plugins-that-used-shared-redis-config).

0 comments on commit a090b5a

Please sign in to comment.