@yuants/vendor-huobi 0.11.11 → 0.11.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuants/vendor-huobi",
3
- "version": "0.11.11",
3
+ "version": "0.11.12",
4
4
  "bin": "lib/cli.js",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -1,18 +1,16 @@
1
1
  {
2
- "apps/vendor-huobi/CHANGELOG.json": "16a021c9e2114017bd94ba6122ec955642242f3e",
3
- "apps/vendor-huobi/CHANGELOG.md": "86d8c58247d93d53e1d5f655eb342291e9e88dbf",
2
+ "apps/vendor-huobi/CHANGELOG.json": "afa002d81cd526890ad91a4a877e8d611cd7d1bc",
3
+ "apps/vendor-huobi/CHANGELOG.md": "8fbad4e6e58f9ef9003fd2c6b55b35a6b401a1dd",
4
4
  "apps/vendor-huobi/README.md": "d7bf0149513114eab5500a6b5c9e7cba10565572",
5
5
  "apps/vendor-huobi/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
6
- "apps/vendor-huobi/build/Dockerfile": "51905c802275985c2558fa8ae5878e9536e799ef",
7
6
  "apps/vendor-huobi/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
8
7
  "apps/vendor-huobi/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
9
8
  "apps/vendor-huobi/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
10
9
  "apps/vendor-huobi/etc/vendor-huobi.api.md": "dc8cbf2a044a227b30a4ee9701b0c97328244724",
11
- "apps/vendor-huobi/package.json": "040e0f0c2528885137babd6347419b89f06d349f",
10
+ "apps/vendor-huobi/package.json": "a1ac4fd425e69f55ceb8da76e7975592956484bf",
12
11
  "apps/vendor-huobi/src/api.ts": "7f13d45da5c3600276cdf4e734e086358d96b348",
13
12
  "apps/vendor-huobi/src/cli.ts": "9bf6b5559a6c6f33da20e74cc6c5d702c60ec891",
14
13
  "apps/vendor-huobi/src/cluster.ts": "f58a96d9c89e29e4fcf7cedd8ea9cb1dc920540b",
15
- "apps/vendor-huobi/src/extension.ts": "59c58a7cd44efcaa69e8a0f16c4461eb8878e92f",
16
14
  "apps/vendor-huobi/src/index.ts": "d14b769d3e840645eab3f7a7f64d47d24e27829c",
17
15
  "apps/vendor-huobi/src/interest_rate.ts": "1ada272b47f382533368928758b35176442d957f",
18
16
  "apps/vendor-huobi/src/logger.ts": "d25d427e74f46819a601e0cb17d5358b22c8db7b",
@@ -1,117 +0,0 @@
1
- (function () {
2
- 'use strict';
3
-
4
- /**
5
- * @public
6
- */
7
- /**
8
- * Generates environment variables in the format of a Docker Compose file.
9
- * @public
10
- * @param env - The environment variables.
11
- * @returns The environment variables in the format of a Docker Compose file.
12
- */
13
- function makeDockerEnvs(env) {
14
- return Object.entries(env !== null && env !== void 0 ? env : {}).map(([k, v]) => `${k}=${v}`);
15
- }
16
- /**
17
- * Generates environment variables in the format of a Kubernetes pod.
18
- * @public
19
- * @param env - The environment variables.
20
- * @returns The environment variables in the format of a Kubernetes pod.
21
- */
22
- function makeK8sEnvs(env) {
23
- return Object.entries(env !== null && env !== void 0 ? env : {}).map(([k, v]) => ({
24
- name: k,
25
- value: `${v}`,
26
- }));
27
- }
28
-
29
- var extension = (context) => {
30
- context.registerDeployProvider({
31
- make_json_schema: () => ({
32
- type: 'object',
33
- properties: {
34
- env: {
35
- type: 'object',
36
- required: ['HOST_URL'],
37
- properties: {
38
- HOST_URL: { type: 'string' },
39
- TERMINAL_ID: { type: 'string' },
40
- ENCRYPTION_KEY_BASE58: { type: 'string' },
41
- },
42
- },
43
- },
44
- }),
45
- make_docker_compose_file: async (ctx, envCtx) => {
46
- var _a;
47
- return {
48
- [`huobi-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
49
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
50
- restart: 'always',
51
- environment: makeDockerEnvs(ctx.env),
52
- },
53
- };
54
- },
55
- make_k8s_resource_objects: async (ctx, envCtx) => {
56
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
57
- return {
58
- deployment: {
59
- apiVersion: 'apps/v1',
60
- kind: 'Deployment',
61
- metadata: {
62
- labels: {
63
- 'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
64
- 'y.ntnl.io/manifest_key': ctx.key,
65
- 'y.ntnl.io/component': 'huobi',
66
- },
67
- name: `huobi-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
68
- namespace: 'yuan',
69
- },
70
- spec: {
71
- replicas: 1,
72
- selector: {
73
- matchLabels: {
74
- 'y.ntnl.io/component': 'huobi',
75
- 'y.ntnl.io/manifest_key': ctx.key,
76
- },
77
- },
78
- template: {
79
- metadata: {
80
- labels: {
81
- 'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
82
- 'y.ntnl.io/manifest_key': ctx.key,
83
- 'y.ntnl.io/component': 'huobi',
84
- },
85
- },
86
- spec: {
87
- containers: [
88
- {
89
- env: makeK8sEnvs(ctx.env),
90
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
91
- imagePullPolicy: 'IfNotPresent',
92
- name: 'huobi',
93
- resources: {
94
- limits: {
95
- cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
96
- memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '256Mi',
97
- },
98
- requests: {
99
- cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '120m',
100
- memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '128Mi',
101
- },
102
- },
103
- },
104
- ],
105
- hostname: 'huobi',
106
- },
107
- },
108
- },
109
- },
110
- };
111
- },
112
- });
113
- };
114
-
115
- return extension;
116
-
117
- })();
package/dist/extension.js DELETED
@@ -1,87 +0,0 @@
1
- import { makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';
2
- export default (context) => {
3
- context.registerDeployProvider({
4
- make_json_schema: () => ({
5
- type: 'object',
6
- properties: {
7
- env: {
8
- type: 'object',
9
- required: ['HOST_URL'],
10
- properties: {
11
- HOST_URL: { type: 'string' },
12
- TERMINAL_ID: { type: 'string' },
13
- ENCRYPTION_KEY_BASE58: { type: 'string' },
14
- },
15
- },
16
- },
17
- }),
18
- make_docker_compose_file: async (ctx, envCtx) => {
19
- var _a;
20
- return {
21
- [`huobi-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
22
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
23
- restart: 'always',
24
- environment: makeDockerEnvs(ctx.env),
25
- },
26
- };
27
- },
28
- make_k8s_resource_objects: async (ctx, envCtx) => {
29
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
30
- return {
31
- deployment: {
32
- apiVersion: 'apps/v1',
33
- kind: 'Deployment',
34
- metadata: {
35
- labels: {
36
- 'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
37
- 'y.ntnl.io/manifest_key': ctx.key,
38
- 'y.ntnl.io/component': 'huobi',
39
- },
40
- name: `huobi-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
41
- namespace: 'yuan',
42
- },
43
- spec: {
44
- replicas: 1,
45
- selector: {
46
- matchLabels: {
47
- 'y.ntnl.io/component': 'huobi',
48
- 'y.ntnl.io/manifest_key': ctx.key,
49
- },
50
- },
51
- template: {
52
- metadata: {
53
- labels: {
54
- 'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
55
- 'y.ntnl.io/manifest_key': ctx.key,
56
- 'y.ntnl.io/component': 'huobi',
57
- },
58
- },
59
- spec: {
60
- containers: [
61
- {
62
- env: makeK8sEnvs(ctx.env),
63
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
64
- imagePullPolicy: 'IfNotPresent',
65
- name: 'huobi',
66
- resources: {
67
- limits: {
68
- cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
69
- memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '256Mi',
70
- },
71
- requests: {
72
- cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '120m',
73
- memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '128Mi',
74
- },
75
- },
76
- },
77
- ],
78
- hostname: 'huobi',
79
- },
80
- },
81
- },
82
- },
83
- };
84
- },
85
- });
86
- };
87
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnF,eAAe,CAAC,OAA0B,EAAE,EAAE;IAC5C,OAAO,CAAC,sBAAsB,CAAC;QAC7B,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;YACvB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,UAAU,CAAC;oBACtB,UAAU,EAAE;wBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC5B,WAAW,EAAE,EAAE,IAAI,EAAE,QA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AAO;oCAClD,wBAAwB,EAAE,GAAG,CAAC,GAAG;oCACjC,qBAAqB,EAAE,OAAO;iCAC/B;6BACF;4BACD,IAAI,EAAE;gCACJ,UAAU,EAAE;oCACV;wCACE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;wCACzB,KAAK,EAAE,yCAAyC,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO,EAAE;wCAC/E,eAAe,EAAE,cAAc;wCAC/B,IAAI,EAAE,OAAO;wCACb,SAAS,EAAE;4CACT,MAAM,EAAE;gDACN,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;4CACD,QAAQ,EAAE;gDACR,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;yCACF;qCACF;iCACF;gCACD,QAAQ,EAAE,OAAO;6BAClB;yBACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { IExtensionContext, makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';\nexport default (context: IExtensionContext) => {\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n HOST_URL: { type: 'string' },\n TERMINAL_ID: { type: 'string' },\n ENCRYPTION_KEY_BASE58: { type: 'string' },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [`huobi-${ctx.env!.ACCESS_KEY}`.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/vendor-huobi:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n return {\n deployment: {\n apiVersion: 'apps/v1',\n kind: 'Deployment',\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'huobi',\n },\n name: `huobi-${ctx.key}`.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': 'huobi',\n 'y.ntnl.io/manifest_key': ctx.key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'huobi',\n },\n },\n spec: {\n containers: [\n {\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/vendor-huobi:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: 'huobi',\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '500m',\n memory: ctx.memory?.max ?? '256Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '120m',\n memory: ctx.memory?.min ?? '128Mi',\n },\n },\n },\n ],\n hostname: 'huobi',\n },\n },\n },\n },\n };\n },\n });\n};\n"]}
@@ -1,4 +0,0 @@
1
- import { IExtensionContext } from '@yuants/extension';
2
- declare const _default: (context: IExtensionContext) => void;
3
- export default _default;
4
- //# sourceMappingURL=extension.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,mBAAmB,CAAC;kCAC1D,iBAAiB;AAA1C,wBAmFE"}
package/lib/extension.js DELETED
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const extension_1 = require("@yuants/extension");
4
- exports.default = (context) => {
5
- context.registerDeployProvider({
6
- make_json_schema: () => ({
7
- type: 'object',
8
- properties: {
9
- env: {
10
- type: 'object',
11
- required: ['HOST_URL'],
12
- properties: {
13
- HOST_URL: { type: 'string' },
14
- TERMINAL_ID: { type: 'string' },
15
- ENCRYPTION_KEY_BASE58: { type: 'string' },
16
- },
17
- },
18
- },
19
- }),
20
- make_docker_compose_file: async (ctx, envCtx) => {
21
- var _a;
22
- return {
23
- [`huobi-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
24
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
25
- restart: 'always',
26
- environment: (0, extension_1.makeDockerEnvs)(ctx.env),
27
- },
28
- };
29
- },
30
- make_k8s_resource_objects: async (ctx, envCtx) => {
31
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
32
- return {
33
- deployment: {
34
- apiVersion: 'apps/v1',
35
- kind: 'Deployment',
36
- metadata: {
37
- labels: {
38
- 'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
39
- 'y.ntnl.io/manifest_key': ctx.key,
40
- 'y.ntnl.io/component': 'huobi',
41
- },
42
- name: `huobi-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
43
- namespace: 'yuan',
44
- },
45
- spec: {
46
- replicas: 1,
47
- selector: {
48
- matchLabels: {
49
- 'y.ntnl.io/component': 'huobi',
50
- 'y.ntnl.io/manifest_key': ctx.key,
51
- },
52
- },
53
- template: {
54
- metadata: {
55
- labels: {
56
- 'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
57
- 'y.ntnl.io/manifest_key': ctx.key,
58
- 'y.ntnl.io/component': 'huobi',
59
- },
60
- },
61
- spec: {
62
- containers: [
63
- {
64
- env: (0, extension_1.makeK8sEnvs)(ctx.env),
65
- image: `ghcr.io/no-trade-no-life/vendor-huobi:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
66
- imagePullPolicy: 'IfNotPresent',
67
- name: 'huobi',
68
- resources: {
69
- limits: {
70
- cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
71
- memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '256Mi',
72
- },
73
- requests: {
74
- cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '120m',
75
- memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '128Mi',
76
- },
77
- },
78
- },
79
- ],
80
- hostname: 'huobi',
81
- },
82
- },
83
- },
84
- },
85
- };
86
- },
87
- });
88
- };
89
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;AAAA,iDAAmF;AACnF,kBAAe,CAAC,OAA0B,EAAE,EAAE;IAC5C,OAAO,CAAC,sBAAsB,CAAC;QAC7B,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;YACvB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,UAAU,CAAC;oBACtB,UAAU,EAAE;wBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC5B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC/B,qBAAqB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1C;iBACF;aACF;SACF,CAAC;QACF,wBAAwB,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;;YAC9C,OAAO;gBACL,CAAC,SAAS,GAAG,CAAC,GAAI,CAAC,U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AE,yCAAyC,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO,EAAE;wCAC/E,eAAe,EAAE,cAAc;wCAC/B,IAAI,EAAE,OAAO;wCACb,SAAS,EAAE;4CACT,MAAM,EAAE;gDACN,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;4CACD,QAAQ,EAAE;gDACR,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;yCACF;qCACF;iCACF;gCACD,QAAQ,EAAE,OAAO;6BAClB;yBACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { IExtensionContext, makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';\nexport default (context: IExtensionContext) => {\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n HOST_URL: { type: 'string' },\n TERMINAL_ID: { type: 'string' },\n ENCRYPTION_KEY_BASE58: { type: 'string' },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [`huobi-${ctx.env!.ACCESS_KEY}`.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/vendor-huobi:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n return {\n deployment: {\n apiVersion: 'apps/v1',\n kind: 'Deployment',\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'huobi',\n },\n name: `huobi-${ctx.key}`.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': 'huobi',\n 'y.ntnl.io/manifest_key': ctx.key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'huobi',\n },\n },\n spec: {\n containers: [\n {\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/vendor-huobi:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: 'huobi',\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '500m',\n memory: ctx.memory?.max ?? '256Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '120m',\n memory: ctx.memory?.min ?? '128Mi',\n },\n },\n },\n ],\n hostname: 'huobi',\n },\n },\n },\n },\n };\n },\n });\n};\n"]}
package/temp/image-tag DELETED
@@ -1 +0,0 @@
1
- sha-56e707120ccde0d021ec1d4d080f5735ed16c610