Skip to content

Commit

Permalink
fix: added support for window stabilization fix through envs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyubabbar committed Sep 6, 2024
1 parent f7783d8 commit fee0727
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/openfaas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const FAAS_AST_FN_NAME = 'fn-ast';
const CUSTOM_NETWORK_POLICY_WORKSPACE_IDS = process.env.CUSTOM_NETWORK_POLICY_WORKSPACE_IDS || '';
const customNetworkPolicyWorkspaceIds = CUSTOM_NETWORK_POLICY_WORKSPACE_IDS.split(',');
const CUSTOMER_TIER = process.env.CUSTOMER_TIER || 'shared';
const FAAS_SCALE_DOWN_WINDOW = process.env.FAAS_SCALE_DOWN_WINDOW || ''; // Go time values are supported ( max 5m or 300s )

// Initialise node cache
const functionListCache = new NodeCache();
Expand Down Expand Up @@ -328,6 +329,10 @@ function buildOpenfaasFn(name, code, versionId, libraryVersionIDs, testMode, trM
'customer-tier': CUSTOMER_TIER,
};

if (FAAS_SCALE_DOWN_WINDOW !== '') {
labels['com.openfaas.scale.down.window'] = FAAS_SCALE_DOWN_WINDOW;

Check warning on line 333 in src/util/openfaas/index.js

View check run for this annotation

Codecov / codecov/patch

src/util/openfaas/index.js#L333

Added line #L333 was not covered by tests
}

if (trMetadata.workspaceId && customNetworkPolicyWorkspaceIds.includes(trMetadata.workspaceId)) {
labels['custom-network-policy'] = 'true';
}
Expand Down

0 comments on commit fee0727

Please sign in to comment.