@codefresh-io/kube-integration 1.33.6 → 2.0.0
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/.deploy/kube-integration/Chart.yaml +4 -4
- package/.deploy/kube-integration/values.yaml +0 -3
- package/.nvmrc +1 -1
- package/CODEOWNERS +8 -6
- package/Dockerfile +6 -6
- package/config/index.js +0 -4
- package/infra/eventbus.js +2 -3
- package/infra/express.js +1 -2
- package/infra/index.js +0 -2
- package/lib/kube-native/deployment/deploy.builder.js +2 -3
- package/lib/kube-native/service/svc.builder.js +2 -3
- package/lib/kube-native/service/svc.controller.js +0 -1
- package/package.json +16 -18
- package/server/api/kube-native/secrets/controller.js +6 -4
- package/service.yaml +1 -2
- package/newrelic.js +0 -35
|
@@ -3,16 +3,16 @@ description: Helm Chart for Kube Integration
|
|
|
3
3
|
name: kube-integration
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
keywords:
|
|
6
|
-
- codefresh
|
|
7
|
-
- kube-integration
|
|
6
|
+
- codefresh
|
|
7
|
+
- kube-integration
|
|
8
8
|
home: https://codefresh.io/
|
|
9
9
|
icon: https://avatars1.githubusercontent.com/u/11412079?v=3
|
|
10
10
|
sources:
|
|
11
|
-
- https://github.com/codefresh-io/kube-integration
|
|
11
|
+
- https://github.com/codefresh-io/kube-integration
|
|
12
12
|
maintainers:
|
|
13
13
|
- name: codefresh
|
|
14
14
|
url: https://codefresh-io.github.io/
|
|
15
15
|
dependencies:
|
|
16
16
|
- name: cf-common
|
|
17
17
|
repository: oci://quay.io/codefresh/charts
|
|
18
|
-
version: "0.
|
|
18
|
+
version: "0.31.0"
|
|
@@ -11,7 +11,6 @@ global:
|
|
|
11
11
|
codefresh: codefresh # On-prem chart name (all subcharts use this name to access secrets and configmaps)
|
|
12
12
|
kubeIntegrationPort: 9000
|
|
13
13
|
kubeIntegrationService: kube-integration
|
|
14
|
-
newrelicLicenseKey: ""
|
|
15
14
|
postgresDatabase: ""
|
|
16
15
|
postgresHostname: ""
|
|
17
16
|
postgresHostnameSecretKeyRef: {}
|
|
@@ -213,8 +212,6 @@ secrets:
|
|
|
213
212
|
RABBITMQ_USERNAME: "{{ coalesce .Values.rabbitmqUsername .Values.global.rabbitmqUsername }}"
|
|
214
213
|
RABBITMQ_PROTOCOL: '{{ coalesce .Values.rabbitmqProtocol .Values.global.rabbitmqProtocol "amqp" }}'
|
|
215
214
|
|
|
216
|
-
NEWRELIC_LICENSE_KEY: '{{ .Values.global.newrelicLicenseKey }}'
|
|
217
|
-
|
|
218
215
|
service:
|
|
219
216
|
main:
|
|
220
217
|
enabled: true
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v24
|
package/CODEOWNERS
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
# review when someone opens a pull request.
|
|
5
|
-
* yaroslav@codefresh.io yaroslav.drachenko@octopus.com denis@codefresh.io zhenya.tikhonov@octopus.com
|
|
1
|
+
# https://github.com/orgs/codefresh-io/teams/r-d/teams
|
|
2
|
+
# use teams and email addresses instead of GitHub usernames
|
|
3
|
+
* @codefresh-io/Codefresh_Developers
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
# team leads are responsible for the codeowners file and the migration scripts
|
|
6
|
+
CODEOWNERS @codefresh-io/teamleads
|
|
7
|
+
|
|
8
|
+
# helm charts for DevOps team
|
|
9
|
+
.deploy/ @codefresh-io/Codefresh_Developers @codefresh-io/DevOps
|
package/Dockerfile
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# DHI source: https://hub.docker.com/repository/docker/octopusdeploy/dhi-node/customizations/
|
|
2
|
-
ARG DHI_NODE_TAG=
|
|
3
|
-
ARG DHI_NODE_CUSTOMIZATION=cf-kube-integration-
|
|
1
|
+
# DHI source: https://hub.docker.com/repository/docker/octopusdeploy/dhi-node/customizations/cz_1xiye92r2ry49
|
|
2
|
+
ARG DHI_NODE_TAG=24-debian13
|
|
3
|
+
ARG DHI_NODE_CUSTOMIZATION=cf-kube-integration-node24-debian-13
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
FROM octopusdeploy/dhi-node:${DHI_NODE_TAG}-dev AS prod-deps
|
|
7
7
|
WORKDIR /kube-integration
|
|
8
|
-
RUN
|
|
8
|
+
RUN apt update \
|
|
9
|
+
&& apt install -y \
|
|
9
10
|
make \
|
|
10
11
|
python3 \
|
|
11
12
|
g++ \
|
|
12
|
-
krb5-dev \
|
|
13
13
|
git
|
|
14
14
|
COPY package.json yarn.lock ./
|
|
15
15
|
RUN yarn install --production --frozen-lockfile
|
|
16
16
|
RUN mkdir /logs
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
FROM octopusdeploy/dhi-node:${DHI_NODE_TAG}_${DHI_NODE_CUSTOMIZATION} AS prod
|
|
19
|
+
FROM octopusdeploy/dhi-node:${DHI_NODE_TAG}_${DHI_NODE_CUSTOMIZATION}@sha256:3a831f3711c6349932c94c9475157444aa1c1452879f34a5d79bcc79e1985b9e AS prod
|
|
20
20
|
WORKDIR /kube-integration
|
|
21
21
|
COPY --chown=node:node --chmod=755 --from=prod-deps /kube-integration/ /kube-integration/
|
|
22
22
|
COPY --chown=node:node --chmod=755 --from=prod-deps /logs/ /logs/
|
package/config/index.js
CHANGED
|
@@ -68,10 +68,6 @@ base.httpLogger = {
|
|
|
68
68
|
format: 'dev'
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
base.newrelic = {
|
|
72
|
-
license_key: process.env.NEWRELIC_LICENSE_KEY
|
|
73
|
-
};
|
|
74
|
-
|
|
75
71
|
base.eventbus = {
|
|
76
72
|
uri: process.env.EVENTBUS_URI || 'amqp://codefresh.dev',
|
|
77
73
|
reconnectInterval: process.env.EVENTBUS_INTERVAL || 5,
|
package/infra/eventbus.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const Promise = require('bluebird');
|
|
4
4
|
const eventBus = require('@codefresh-io/eventbus');
|
|
5
|
-
const monitor = require('@codefresh-io/cf-monitor');
|
|
6
5
|
const logger = require('cf-logs').Logger("codefresh:infra:eventbus");
|
|
7
6
|
const config = require('./../config');
|
|
8
7
|
|
|
@@ -53,7 +52,7 @@ class Eventbus {
|
|
|
53
52
|
eventBus.on('error', (err) => {
|
|
54
53
|
const error = new Error(`Eventbus error: ${err.stack}`);
|
|
55
54
|
logger.error(error.stack);
|
|
56
|
-
monitor.noticeError(error);
|
|
55
|
+
// monitor.noticeError(error); // Used earlier to report an error to New Relic
|
|
57
56
|
});
|
|
58
57
|
|
|
59
58
|
return deferred.promise;
|
|
@@ -93,7 +92,7 @@ class Eventbus {
|
|
|
93
92
|
eventBus.publish(name, data)
|
|
94
93
|
.catch((err) => {
|
|
95
94
|
logger.error(err.stack);
|
|
96
|
-
monitor.noticeError(err);
|
|
95
|
+
// monitor.noticeError(err); // Used earlier to report an error to New Relic
|
|
97
96
|
})
|
|
98
97
|
.done();
|
|
99
98
|
}
|
package/infra/express.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const monitor = require('@codefresh-io/cf-monitor');
|
|
4
3
|
const Promise = require('bluebird');
|
|
5
4
|
const express = require('express');
|
|
6
5
|
const compression = require('compression');
|
|
@@ -143,7 +142,7 @@ class Express {
|
|
|
143
142
|
app.use((err, req, res, next) => {
|
|
144
143
|
if (err instanceof CFError) {
|
|
145
144
|
if (!err.getFirstValue("recognized")) {
|
|
146
|
-
monitor.noticeError(err);
|
|
145
|
+
// monitor.noticeError(err); // Used earlier to report an error to New Relic
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
logger.error(err.stack);
|
package/infra/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const logging = require('./logging');
|
|
4
4
|
const config = require('../config');
|
|
5
|
-
const monitor = require('@codefresh-io/cf-monitor');
|
|
6
|
-
monitor.init();
|
|
7
5
|
const Promise = require('bluebird'); // jshint ignore:line
|
|
8
6
|
const processEvents = require('./process-events');
|
|
9
7
|
const express = require('./express');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
|
-
const uuidv4 = require('uuid/v4');
|
|
5
4
|
const BaseBuilder = require('./../../kube-native/builder.base');
|
|
6
5
|
const CFError = require('cf-errors');
|
|
7
6
|
|
|
@@ -52,7 +51,7 @@ class DeployBuilder extends BaseBuilder {
|
|
|
52
51
|
|
|
53
52
|
_buildAnnotations() {
|
|
54
53
|
this._shouldMarkAnnotations() && this.updateTemplate('spec.template.metadata.annotations', {
|
|
55
|
-
forceRedeployUniqId:
|
|
54
|
+
forceRedeployUniqId: globalThis.crypto.randomUUID(),
|
|
56
55
|
});
|
|
57
56
|
return this;
|
|
58
57
|
}
|
|
@@ -176,7 +175,7 @@ class DeployBuilder extends BaseBuilder {
|
|
|
176
175
|
|
|
177
176
|
_buildLabels() {
|
|
178
177
|
this.shouldMarkWithLabels() && this.updateTemplate('spec.template.metadata.labels', {
|
|
179
|
-
['io.codefresh.auto-generated']:
|
|
178
|
+
['io.codefresh.auto-generated']: globalThis.crypto.randomUUID(),
|
|
180
179
|
['io.codefresh.generated-at']: Date.now().toString()
|
|
181
180
|
});
|
|
182
181
|
this.updateTemplate('metadata.labels', this._getTemplateLabels());
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
const BaseBuilder = require('./../../kube-native/builder.base');
|
|
5
|
-
const uuidv4 = require('uuid/v4');
|
|
6
5
|
|
|
7
6
|
class ServiceBuilder extends BaseBuilder {
|
|
8
7
|
|
|
@@ -57,11 +56,11 @@ class ServiceBuilder extends BaseBuilder {
|
|
|
57
56
|
|
|
58
57
|
_buildLabels(){
|
|
59
58
|
this.shouldMarkWithLabels() && this.updateTemplate('metadata.labels', {
|
|
60
|
-
['io.codefresh.auto-generated']:
|
|
59
|
+
['io.codefresh.auto-generated']: globalThis.crypto.randomUUID(),
|
|
61
60
|
['io.codefresh.generated-at']: Date.now().toString()
|
|
62
61
|
});
|
|
63
62
|
return this;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
module.exports = ServiceBuilder;
|
|
66
|
+
module.exports = ServiceBuilder;
|
|
@@ -106,7 +106,6 @@ class ServiceController extends ResourсeController {
|
|
|
106
106
|
})
|
|
107
107
|
})
|
|
108
108
|
.catch((err) => {
|
|
109
|
-
// todo: report to new relic
|
|
110
109
|
const analyzedStatus = this._analyzeStatus({ svc });
|
|
111
110
|
return _.merge(svc.getBasicData(), { globalStatus: analyzedStatus });
|
|
112
111
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "2.0.0",
|
|
3
3
|
"name": "@codefresh-io/kube-integration",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "git+https://github.com/codefresh-io/kube-integration.git"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": "^
|
|
22
|
+
"node": "^24"
|
|
23
23
|
},
|
|
24
24
|
"author": "Oleg Sucharevich <olegs@codefresh.io>",
|
|
25
25
|
"license": "ISC",
|
|
@@ -32,34 +32,32 @@
|
|
|
32
32
|
"tough-cookie": "4.1.3",
|
|
33
33
|
"@kubernetes/client-node": "0.22.1",
|
|
34
34
|
"**/request/form-data": "^2.4.5",
|
|
35
|
-
"**/request/qs": "6.14.
|
|
35
|
+
"**/request/qs": "6.14.2"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@codefresh-io/
|
|
39
|
-
"@codefresh-io/
|
|
40
|
-
"@codefresh-io/
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"cf-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"cookie-parser": "^1.4.3",
|
|
38
|
+
"@codefresh-io/docker-reference": "^0.1.0",
|
|
39
|
+
"@codefresh-io/eventbus": "^2.4.0",
|
|
40
|
+
"@codefresh-io/http-infra": "^1.8.15",
|
|
41
|
+
"bluebird": "^3.7.2",
|
|
42
|
+
"cf-errors": "^0.1.17",
|
|
43
|
+
"cf-logs": "^1.1.28",
|
|
44
|
+
"compression": "^1.8.1",
|
|
45
|
+
"cookie-parser": "^1.4.7",
|
|
47
46
|
"eventemitter2": "^4.1.2",
|
|
48
47
|
"express": "^4.22.1",
|
|
49
48
|
"google-protobuf": "^3.5.0",
|
|
50
49
|
"js-yaml": "^3.13.1",
|
|
51
50
|
"kube-config-builder": "^1.1.3",
|
|
52
51
|
"kubernetes-client": "^9.0.0",
|
|
53
|
-
"lodash": "
|
|
52
|
+
"lodash": "^4.18.1",
|
|
54
53
|
"method-override": "^2.3.9",
|
|
55
|
-
"morgan": "^1.10.
|
|
54
|
+
"morgan": "^1.10.1",
|
|
56
55
|
"nock": "^12.0.3",
|
|
57
|
-
"nodegistry": "^1.
|
|
56
|
+
"nodegistry": "^1.3.1",
|
|
58
57
|
"object-hash": "^1.2.0",
|
|
58
|
+
"qs": "^6.15.1",
|
|
59
59
|
"request": "^2.88.2",
|
|
60
|
-
"request-promise": "^4.2.6"
|
|
61
|
-
"uuid": "^3.1.0",
|
|
62
|
-
"qs": "^6.14.1"
|
|
60
|
+
"request-promise": "^4.2.6"
|
|
63
61
|
},
|
|
64
62
|
"devDependencies": {
|
|
65
63
|
"chai": "^3.5.0",
|
|
@@ -4,18 +4,20 @@ const _ = require('lodash');
|
|
|
4
4
|
const Promise = require('bluebird');
|
|
5
5
|
const {
|
|
6
6
|
registries: { GcrRegistry, EcrRegistry, StandardRegistry }
|
|
7
|
-
|
|
7
|
+
} = require('nodegistry');
|
|
8
|
+
const { getAuthenticatedEntity } = require('@codefresh-io/http-infra');
|
|
8
9
|
const ResponseHandler = require('./../../../helpers/ResponseHandler');
|
|
9
10
|
const BaseCrudController = require('./../../crud.base.controller');
|
|
10
11
|
const globalLabels = require('./../../../../lib/labels');
|
|
11
12
|
const secretLabels = require('./../../../../lib/kube-native/secret/secret.labels');
|
|
12
13
|
const CFError = require('cf-errors');
|
|
13
14
|
|
|
14
|
-
function create(options) {
|
|
15
|
+
async function create(options) {
|
|
15
16
|
switch (options.kind) {
|
|
16
17
|
case 'google':
|
|
17
18
|
return new GcrRegistry(options);
|
|
18
19
|
case 'amazon':
|
|
20
|
+
options.validateAwsRegion = await getAuthenticatedEntity().evaluateFeatureFlag('enableAwsRegionStrictValidation')
|
|
19
21
|
return new EcrRegistry(options);
|
|
20
22
|
case 'standard':
|
|
21
23
|
return new StandardRegistry(options);
|
|
@@ -70,8 +72,8 @@ class Controller extends BaseCrudController {
|
|
|
70
72
|
}
|
|
71
73
|
return registry;
|
|
72
74
|
})
|
|
73
|
-
.then((registry) => {
|
|
74
|
-
const manager = create(registry);
|
|
75
|
+
.then(async (registry) => {
|
|
76
|
+
const manager = await create(registry);
|
|
75
77
|
return Promise.all([
|
|
76
78
|
manager.getDomain(),
|
|
77
79
|
manager.getCredentials(),
|
package/service.yaml
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
version:
|
|
2
|
-
|
|
1
|
+
version: 2.0.0
|
package/newrelic.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const config = require('./config');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* New Relic agent configuration.
|
|
8
|
-
*
|
|
9
|
-
* See lib/config.defaults.js in the agent distribution for a more complete
|
|
10
|
-
* description of configuration variables and their potential values.
|
|
11
|
-
*/
|
|
12
|
-
exports.config = {
|
|
13
|
-
/**
|
|
14
|
-
* Array of application names.
|
|
15
|
-
*/
|
|
16
|
-
app_name: [`${config.name}[${config.env}]`],
|
|
17
|
-
/**
|
|
18
|
-
* Your New Relic license key.
|
|
19
|
-
*/
|
|
20
|
-
license_key: config.newrelic.license_key,
|
|
21
|
-
|
|
22
|
-
logging: {
|
|
23
|
-
/**
|
|
24
|
-
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
|
|
25
|
-
* issues with the agent, 'info' and higher will impose the least overhead on
|
|
26
|
-
* production applications.
|
|
27
|
-
*/
|
|
28
|
-
enabled: false,
|
|
29
|
-
level: 'info'
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
error_collector: {
|
|
33
|
-
ignore_status_codes: ['400-600']
|
|
34
|
-
}
|
|
35
|
-
};
|