1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: add environments to resource limit schema (#7495)

This PR adds limits for environments to the resource limit schema. The
actual limiting will have to be done in Enterprise, however, so this is
just laying the groundwork.
This commit is contained in:
Thomas Heartman 2024-07-01 11:20:22 +02:00 committed by GitHub
parent 20da40d38d
commit 441c399f58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -196,6 +196,7 @@ exports[`should create default config 1`] = `
"actionSetFilterValues": 25,
"actionSetFilters": 5,
"actionSetsPerProject": 5,
"environments": 50,
"featureEnvironmentStrategies": 30,
"segmentValues": 1000,
"signalEndpoints": 5,

View File

@ -653,6 +653,10 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
process.env.UNLEASH_FEATURE_ENVIRONMENT_STRATEGIES_LIMIT,
30,
),
environments: parseEnvVarNumber(
process.env.UNLEASH_ENVIRONMENTS_LIMIT,
50,
),
};
return {

View File

@ -14,6 +14,7 @@ export const resourceLimitsSchema = {
'signalEndpoints',
'signalTokensPerEndpoint',
'featureEnvironmentStrategies',
'environments',
],
additionalProperties: false,
properties: {
@ -68,6 +69,12 @@ export const resourceLimitsSchema = {
description:
'The maximum number of feature environment strategies allowed.',
},
environments: {
type: 'integer',
minimum: 1,
example: 50,
description: 'The maximum number active environments allowed.',
},
},
components: {},
} as const;