Skip to content

Commit 8dc04ed

Browse files
author
Sankeerth
authored
chore(release): pull main into develop post release v1.77.1 (#3714)
2 parents 632d9af + 5db0bfb commit 8dc04ed

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [1.77.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.77.0...v1.77.1) (2024-09-05)
6+
7+
8+
### Bug Fixes
9+
10+
* add namespace and cluster labels to python transformation functions ([255f3e5](https://github.com/rudderlabs/rudder-transformer/commit/255f3e52fb66ae6cb55e24938fff60ec6e28b285))
11+
512
## [1.77.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.76.1...v1.77.0) (2024-09-02)
613

714

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rudder-transformer",
3-
"version": "1.77.0",
3+
"version": "1.77.1",
44
"description": "",
55
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
66
"bugs": {

src/util/customTransformer-faas.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const {
88
executeFaasFunction,
99
FAAS_AST_FN_NAME,
1010
FAAS_AST_VID,
11+
PARENT_NAMESPACE,
12+
PARENT_CLUSTER,
1113
} = require('./openfaas');
1214
const { getLibraryCodeV1 } = require('./customTransforrmationsStore-v1');
1315

@@ -26,6 +28,8 @@ function generateFunctionName(userTransformation, libraryVersionIds, testMode, h
2628
(libraryVersionIds || []).sort(),
2729
);
2830

31+
ids = ids.concat([PARENT_NAMESPACE, PARENT_CLUSTER]);
32+
2933
if (hashSecret !== '') {
3034
ids = ids.concat([hashSecret]);
3135
}

src/util/openfaas/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const FAAS_READINESS_HTTP_FAILURE_THRESHOLD =
3838
const FAAS_READINESS_HTTP_SUCCESS_THRESHOLD =
3939
process.env.FAAS_READINESS_HTTP_SUCCESS_THRESHOLD || '1';
4040

41+
const PARENT_NAMESPACE = process.env.NAMESPACE || 'default';
42+
const PARENT_CLUSTER = process.env.FAAS_FN_PARENT_CLUSTER || 'default';
43+
4144
const CONFIG_BACKEND_URL = process.env.CONFIG_BACKEND_URL || 'https://api.rudderlabs.com';
4245
const GEOLOCATION_URL = process.env.GEOLOCATION_URL || '';
4346
const FAAS_AST_VID = 'ast';
@@ -314,6 +317,8 @@ function buildOpenfaasFn(name, code, versionId, libraryVersionIDs, testMode, trM
314317
const labels = {
315318
'openfaas-fn': 'true',
316319
'parent-component': 'openfaas',
320+
'parent-namespace': PARENT_NAMESPACE,
321+
'parent-cluster': PARENT_CLUSTER,
317322
'com.openfaas.scale.max': FAAS_MAX_PODS_IN_TEXT,
318323
'com.openfaas.scale.min': FAAS_MIN_PODS_IN_TEXT,
319324
'com.openfaas.scale.zero': FAAS_SCALE_ZERO,
@@ -436,6 +441,8 @@ module.exports = {
436441
buildOpenfaasFn,
437442
FAAS_AST_VID,
438443
FAAS_AST_FN_NAME,
444+
PARENT_NAMESPACE,
445+
PARENT_CLUSTER,
439446
setFunctionInCache,
440447
reconcileFunction,
441448
};

test/__tests__/user_transformation.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const pyLibCode = (name, versionId) => {
9292

9393
const pyfaasFuncName = (workspaceId, versionId, libraryVersionIds=[], hashSecret="") => {
9494
let ids = [workspaceId, versionId].concat(libraryVersionIds.sort());
95+
ids = ids.concat(["default", "default"]);
9596
if (hashSecret !== "") {
9697
ids = ids.concat([hashSecret]);
9798
}
@@ -119,7 +120,7 @@ describe("User transformation utils", () => {
119120
[],
120121
false,
121122
'hash-secret');
122-
expect(fnName).toEqual('fn-workspaceid-34a32ade07ebbc7bc5ea795b8200de9f');
123+
expect(fnName).toEqual('fn-workspaceid-91d66b4cea6f0ed16cd41258d138d0a8');
123124
});
124125

125126
});

0 commit comments

Comments
 (0)