@datadog/datadog-ci-plugin-container-app 5.12.1 → 5.13.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/dist/bundle.d.ts +7444 -0
- package/dist/bundle.js +153425 -0
- package/dist/bundle.js.LEGAL.txt +2714 -0
- package/dist/bundle.js.map +1 -0
- package/dist/commands/instrument.js +2 -180
- package/dist/commands/uninstrument.js +2 -139
- package/package.json +15 -7
- package/dist/commands/instrument.d.ts +0 -18
- package/dist/commands/instrument.js.map +0 -1
- package/dist/commands/uninstrument.d.ts +0 -19
- package/dist/commands/uninstrument.js.map +0 -1
- package/dist/common.d.ts +0 -4
- package/dist/common.js +0 -18
- package/dist/common.js.map +0 -1
|
@@ -1,180 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PluginCommand = void 0;
|
|
16
|
-
const arm_appcontainers_1 = require("@azure/arm-appcontainers");
|
|
17
|
-
const arm_resources_1 = require("@azure/arm-resources");
|
|
18
|
-
const identity_1 = require("@azure/identity");
|
|
19
|
-
const instrument_1 = require("@datadog/datadog-ci-base/commands/container-app/instrument");
|
|
20
|
-
const api_1 = require("@datadog/datadog-ci-base/helpers/api");
|
|
21
|
-
const apikey_1 = require("@datadog/datadog-ci-base/helpers/apikey");
|
|
22
|
-
const renderer_1 = require("@datadog/datadog-ci-base/helpers/renderer");
|
|
23
|
-
const azure_1 = require("@datadog/datadog-ci-base/helpers/serverless/azure");
|
|
24
|
-
const common_1 = require("@datadog/datadog-ci-base/helpers/serverless/common");
|
|
25
|
-
const constants_1 = require("@datadog/datadog-ci-base/helpers/serverless/constants");
|
|
26
|
-
const source_code_integration_1 = require("@datadog/datadog-ci-base/helpers/serverless/source-code-integration");
|
|
27
|
-
const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
|
|
28
|
-
const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
|
|
29
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
30
|
-
const common_2 = require("../common");
|
|
31
|
-
class PluginCommand extends instrument_1.ContainerAppInstrumentCommand {
|
|
32
|
-
execute() {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
this.enableFips();
|
|
36
|
-
const [containerAppsToInstrument, config, errors] = yield this.ensureConfig();
|
|
37
|
-
if (errors.length > 0) {
|
|
38
|
-
for (const error of errors) {
|
|
39
|
-
this.context.stdout.write((0, renderer_1.renderError)(error));
|
|
40
|
-
}
|
|
41
|
-
return 1;
|
|
42
|
-
}
|
|
43
|
-
try {
|
|
44
|
-
const isApiKeyValid = yield (0, apikey_1.newApiKeyValidator)({
|
|
45
|
-
apiKey: process.env.DD_API_KEY,
|
|
46
|
-
datadogSite: (0, api_1.getDatadogSite)(),
|
|
47
|
-
}).validateApiKey();
|
|
48
|
-
if (!isApiKeyValid) {
|
|
49
|
-
throw Error();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
this.context.stdout.write((0, renderer_1.renderSoftWarning)(`Invalid API Key stored in the environment variable ${chalk_1.default.bold('DD_API_KEY')}: ${(0, utils_1.maskString)((_a = process.env.DD_API_KEY) !== null && _a !== void 0 ? _a : '')}\nEnsure you copied the value and not the Key ID.`));
|
|
54
|
-
return 1;
|
|
55
|
-
}
|
|
56
|
-
this.cred = new identity_1.DefaultAzureCredential();
|
|
57
|
-
if (!(yield (0, azure_1.ensureAzureAuth)((msg) => this.context.stdout.write(msg), this.cred))) {
|
|
58
|
-
return 1;
|
|
59
|
-
}
|
|
60
|
-
this.tagClient = new arm_resources_1.ResourceManagementClient(this.cred).tagsOperations;
|
|
61
|
-
if (config.sourceCodeIntegration) {
|
|
62
|
-
config.extraTags = yield (0, source_code_integration_1.handleSourceCodeIntegration)(this.context, (_b = config.uploadGitMetadata) !== null && _b !== void 0 ? _b : true, config.extraTags);
|
|
63
|
-
}
|
|
64
|
-
this.context.stdout.write(`${this.dryRunPrefix}🐶 Beginning instrumentation of Azure Container App(s)\n`);
|
|
65
|
-
const results = yield Promise.all(Object.entries(containerAppsToInstrument).map(([subscriptionId, resourceGroupToNames]) => this.processSubscription(subscriptionId, resourceGroupToNames, config)));
|
|
66
|
-
const success = results.every((result) => result);
|
|
67
|
-
this.context.stdout.write(`${this.dryRunPrefix}🐶 Instrumentation completed ${success ? 'successfully!' : 'with errors, see above for details.'}\n`);
|
|
68
|
-
return success ? 0 : 1;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
processSubscription(subscriptionId, resourceGroupToNames, config) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
const containerAppClient = new arm_appcontainers_1.ContainerAppsAPIClient(this.cred, subscriptionId);
|
|
74
|
-
const results = yield Promise.all(Object.entries(resourceGroupToNames).flatMap(([resourceGroup, containerAppNames]) => containerAppNames.map((containerAppName) => this.processContainerApp(containerAppClient, config, resourceGroup, containerAppName))));
|
|
75
|
-
return results.every((result) => result);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Process an Azure Container App for instrumentation.
|
|
80
|
-
* @returns A promise that resolves to a boolean indicating success or failure.
|
|
81
|
-
*/
|
|
82
|
-
processContainerApp(containerAppClient, config, resourceGroup, containerAppName) {
|
|
83
|
-
var _a;
|
|
84
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
try {
|
|
86
|
-
const [containerApp, secrets] = yield Promise.all([
|
|
87
|
-
containerAppClient.containerApps.get(resourceGroup, containerAppName),
|
|
88
|
-
containerAppClient.containerApps.listSecrets(resourceGroup, containerAppName),
|
|
89
|
-
]);
|
|
90
|
-
// insert secrets since they're not exposed by the get api
|
|
91
|
-
containerApp.configuration = Object.assign(Object.assign({}, containerApp.configuration), { secrets: secrets.value });
|
|
92
|
-
config = Object.assign(Object.assign({}, config), { service: (_a = config.service) !== null && _a !== void 0 ? _a : containerAppName });
|
|
93
|
-
yield this.instrumentSidecar(containerAppClient, config, resourceGroup, containerApp);
|
|
94
|
-
yield this.addTags(config, containerAppClient.subscriptionId, resourceGroup, containerApp);
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
this.context.stdout.write((0, renderer_1.renderError)(`Failed to instrument ${containerAppName}: ${(0, azure_1.formatError)(error)}`));
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
addTags(config, subscriptionId, resourceGroup, containerApp) {
|
|
104
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
const updatedTags = Object.assign(Object.assign({}, containerApp.tags), { service: config.service, [tags_1.SERVERLESS_CLI_VERSION_TAG_NAME]: tags_1.SERVERLESS_CLI_VERSION_TAG_VALUE });
|
|
106
|
-
if (config.environment) {
|
|
107
|
-
updatedTags.env = config.environment;
|
|
108
|
-
}
|
|
109
|
-
if (config.version) {
|
|
110
|
-
updatedTags.version = config.version;
|
|
111
|
-
}
|
|
112
|
-
if (!(0, common_1.sortedEqual)(containerApp.tags, updatedTags)) {
|
|
113
|
-
this.context.stdout.write(`${this.dryRunPrefix}Updating tags for ${chalk_1.default.bold(containerApp.name)}\n`);
|
|
114
|
-
if (!this.dryRun) {
|
|
115
|
-
try {
|
|
116
|
-
yield this.tagClient.beginCreateOrUpdateAtScopeAndWait(`/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.App/containerApps/${containerApp.name}`, { properties: { tags: updatedTags } });
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
this.context.stdout.write((0, renderer_1.renderError)(`Failed to update tags for ${chalk_1.default.bold(containerApp.name)}: ${(0, azure_1.formatError)(error)}`));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
instrumentSidecar(client, config, resourceGroup, containerApp) {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
const updatedAppConfig = this.createInstrumentedAppConfig(config, client.subscriptionId, resourceGroup, containerApp);
|
|
128
|
-
if ((0, common_1.sortedEqual)(containerApp, updatedAppConfig)) {
|
|
129
|
-
this.context.stdout.write(`${this.dryRunPrefix}Sidecar container ${chalk_1.default.bold(config.sidecarName)} already exists with correct configuration.\n`);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const configDiff = (0, common_1.generateConfigDiff)(containerApp, updatedAppConfig);
|
|
133
|
-
this.context.stdout.write(`${this.dryRunPrefix}Updating configuration for ${chalk_1.default.bold(containerApp.name)}:\n${configDiff}\n`);
|
|
134
|
-
if (!this.dryRun) {
|
|
135
|
-
yield client.containerApps.beginUpdateAndWait(resourceGroup, containerApp.name, updatedAppConfig);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
createInstrumentedAppConfig(config, subscriptionId, resourceGroup, containerApp) {
|
|
140
|
-
var _a, _b, _c, _d, _e;
|
|
141
|
-
const envVarsByName = (0, common_2.getEnvVarsByName)(config, subscriptionId, resourceGroup);
|
|
142
|
-
// Build base sidecar container
|
|
143
|
-
const baseSidecar = {
|
|
144
|
-
name: config.sidecarName,
|
|
145
|
-
image: constants_1.SIDECAR_IMAGE,
|
|
146
|
-
resources: {
|
|
147
|
-
cpu: (_a = config.sidecarCpu) !== null && _a !== void 0 ? _a : instrument_1.DEFAULT_SIDECAR_CPU,
|
|
148
|
-
memory: ((_b = config.sidecarMemory) !== null && _b !== void 0 ? _b : instrument_1.DEFAULT_SIDECAR_MEMORY) + 'Gi',
|
|
149
|
-
},
|
|
150
|
-
probes: [
|
|
151
|
-
{
|
|
152
|
-
type: 'Startup',
|
|
153
|
-
tcpSocket: {
|
|
154
|
-
port: constants_1.DEFAULT_HEALTH_CHECK_PORT,
|
|
155
|
-
},
|
|
156
|
-
initialDelaySeconds: 0,
|
|
157
|
-
periodSeconds: 10,
|
|
158
|
-
failureThreshold: 3,
|
|
159
|
-
timeoutSeconds: 1,
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
// Use shared helper to create instrumented template
|
|
164
|
-
const updatedTemplate = (0, common_1.createInstrumentedTemplate)((_c = containerApp.template) !== null && _c !== void 0 ? _c : {}, baseSidecar, {
|
|
165
|
-
name: config.sharedVolumeName,
|
|
166
|
-
mountPath: config.sharedVolumePath,
|
|
167
|
-
mountOptions: { storageType: 'EmptyDir' },
|
|
168
|
-
volumeMountNameKey: 'volumeName',
|
|
169
|
-
}, envVarsByName);
|
|
170
|
-
const secrets = (_e = (_d = containerApp.configuration) === null || _d === void 0 ? void 0 : _d.secrets) !== null && _e !== void 0 ? _e : [];
|
|
171
|
-
const hasApiKey = secrets.some(({ name }) => name === common_2.DD_API_KEY_SECRET_NAME);
|
|
172
|
-
const updatedSecrets = secrets.map((secret) => secret.name === common_2.DD_API_KEY_SECRET_NAME ? { name: common_2.DD_API_KEY_SECRET_NAME, value: process.env.DD_API_KEY } : secret);
|
|
173
|
-
if (!hasApiKey) {
|
|
174
|
-
updatedSecrets.push({ name: common_2.DD_API_KEY_SECRET_NAME, value: process.env.DD_API_KEY });
|
|
175
|
-
}
|
|
176
|
-
return Object.assign(Object.assign({}, containerApp), { configuration: Object.assign(Object.assign({}, containerApp.configuration), { secrets: updatedSecrets }), template: updatedTemplate });
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.PluginCommand = PluginCommand;
|
|
180
|
-
//# sourceMappingURL=instrument.js.map
|
|
1
|
+
"use strict"
|
|
2
|
+
module.exports = require("../bundle.js").commands["instrument"]
|
|
@@ -1,139 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PluginCommand = void 0;
|
|
16
|
-
const arm_appcontainers_1 = require("@azure/arm-appcontainers");
|
|
17
|
-
const arm_resources_1 = require("@azure/arm-resources");
|
|
18
|
-
const identity_1 = require("@azure/identity");
|
|
19
|
-
const uninstrument_1 = require("@datadog/datadog-ci-base/commands/container-app/uninstrument");
|
|
20
|
-
const renderer_1 = require("@datadog/datadog-ci-base/helpers/renderer");
|
|
21
|
-
const azure_1 = require("@datadog/datadog-ci-base/helpers/serverless/azure");
|
|
22
|
-
const common_1 = require("@datadog/datadog-ci-base/helpers/serverless/common");
|
|
23
|
-
const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
|
|
24
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
25
|
-
const common_2 = require("../common");
|
|
26
|
-
class PluginCommand extends uninstrument_1.ContainerAppUninstrumentCommand {
|
|
27
|
-
execute() {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
this.enableFips();
|
|
30
|
-
const [containerAppsToUninstrument, config, errors] = yield this.ensureConfig();
|
|
31
|
-
if (errors.length > 0) {
|
|
32
|
-
for (const error of errors) {
|
|
33
|
-
this.context.stdout.write((0, renderer_1.renderError)(error));
|
|
34
|
-
}
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
37
|
-
this.cred = new identity_1.DefaultAzureCredential();
|
|
38
|
-
if (!(yield (0, azure_1.ensureAzureAuth)((msg) => this.context.stdout.write(msg), this.cred))) {
|
|
39
|
-
return 1;
|
|
40
|
-
}
|
|
41
|
-
this.tagClient = new arm_resources_1.ResourceManagementClient(this.cred).tagsOperations;
|
|
42
|
-
this.context.stdout.write(`${this.dryRunPrefix}🐶 Beginning uninstrumentation of Azure Container App(s)\n`);
|
|
43
|
-
const results = yield Promise.all(Object.entries(containerAppsToUninstrument).map(([subscriptionId, resourceGroupToNames]) => this.processSubscription(subscriptionId, resourceGroupToNames, config)));
|
|
44
|
-
const success = results.every((result) => result);
|
|
45
|
-
this.context.stdout.write(`${this.dryRunPrefix}🐶 Uninstrumentation completed ${success ? 'successfully!' : 'with errors, see above for details.'}\n`);
|
|
46
|
-
return success ? 0 : 1;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
processSubscription(subscriptionId, resourceGroupToNames, config) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const containerAppClient = new arm_appcontainers_1.ContainerAppsAPIClient(this.cred, subscriptionId);
|
|
52
|
-
const results = yield Promise.all(Object.entries(resourceGroupToNames).flatMap(([resourceGroup, containerAppNames]) => containerAppNames.map((containerAppName) => this.processContainerApp(containerAppClient, config, resourceGroup, containerAppName, subscriptionId))));
|
|
53
|
-
return results.every((result) => result);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Process an Azure Container App for uninstrumentation.
|
|
58
|
-
* @returns A promise that resolves to a boolean indicating success or failure.
|
|
59
|
-
*/
|
|
60
|
-
processContainerApp(containerAppClient, config, resourceGroup, containerAppName, subscriptionId) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
try {
|
|
63
|
-
const containerApp = yield containerAppClient.containerApps.get(resourceGroup, containerAppName);
|
|
64
|
-
yield this.uninstrumentSidecar(containerAppClient, config, resourceGroup, containerApp);
|
|
65
|
-
yield this.removeTags(subscriptionId, resourceGroup, containerApp);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
this.context.stdout.write((0, renderer_1.renderError)(`Failed to uninstrument ${containerAppName}: ${(0, azure_1.formatError)(error)}`));
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
return true;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
removeTags(subscriptionId, resourceGroup, containerApp) {
|
|
75
|
-
var _a, _b, _c, _d;
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const updatedTags = Object.assign({}, containerApp.tags);
|
|
78
|
-
delete updatedTags.service;
|
|
79
|
-
delete updatedTags.env;
|
|
80
|
-
delete updatedTags.version;
|
|
81
|
-
delete updatedTags[tags_1.SERVERLESS_CLI_VERSION_TAG_NAME];
|
|
82
|
-
const tagsChanged = ((_a = containerApp.tags) === null || _a === void 0 ? void 0 : _a.service) ||
|
|
83
|
-
((_b = containerApp.tags) === null || _b === void 0 ? void 0 : _b.env) ||
|
|
84
|
-
((_c = containerApp.tags) === null || _c === void 0 ? void 0 : _c.version) ||
|
|
85
|
-
((_d = containerApp.tags) === null || _d === void 0 ? void 0 : _d[tags_1.SERVERLESS_CLI_VERSION_TAG_NAME]);
|
|
86
|
-
if (tagsChanged) {
|
|
87
|
-
this.context.stdout.write(`${this.dryRunPrefix}Removing tags from ${chalk_1.default.bold(containerApp.name)}\n`);
|
|
88
|
-
if (!this.dryRun) {
|
|
89
|
-
try {
|
|
90
|
-
yield this.tagClient.beginCreateOrUpdateAtScopeAndWait(`/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.App/containerApps/${containerApp.name}`, { properties: { tags: updatedTags } });
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
this.context.stdout.write((0, renderer_1.renderError)(`Failed to remove tags from ${chalk_1.default.bold(containerApp.name)}: ${(0, azure_1.formatError)(error)}`));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
uninstrumentSidecar(client, config, resourceGroup, containerApp) {
|
|
100
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
const updatedAppConfig = this.createUninstrumentedAppConfig(config, containerApp);
|
|
102
|
-
const configDiff = (0, common_1.generateConfigDiff)(containerApp, updatedAppConfig);
|
|
103
|
-
this.context.stdout.write(`${this.dryRunPrefix}Updating configuration for ${chalk_1.default.bold(containerApp.name)}:\n${configDiff}\n`);
|
|
104
|
-
if (!this.dryRun) {
|
|
105
|
-
yield client.containerApps.beginUpdateAndWait(resourceGroup, containerApp.name, updatedAppConfig);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
createUninstrumentedAppConfig(config, containerApp) {
|
|
110
|
-
var _a, _b, _c, _d, _e;
|
|
111
|
-
const containers = (_b = (_a = containerApp === null || containerApp === void 0 ? void 0 : containerApp.template) === null || _a === void 0 ? void 0 : _a.containers) !== null && _b !== void 0 ? _b : [];
|
|
112
|
-
const volumes = ((_c = containerApp === null || containerApp === void 0 ? void 0 : containerApp.template) === null || _c === void 0 ? void 0 : _c.volumes) || [];
|
|
113
|
-
// Remove sidecar container
|
|
114
|
-
let updatedContainers = containers.filter((c) => c.name !== config.sidecarName);
|
|
115
|
-
if (updatedContainers.length === containers.length) {
|
|
116
|
-
this.context.stdout.write((0, renderer_1.renderSoftWarning)(`Sidecar container '${config.sidecarName}' not found, so no container was removed. Specify the container name with --sidecar-name.\n`));
|
|
117
|
-
}
|
|
118
|
-
// Remove shared volume
|
|
119
|
-
const updatedVolumes = volumes.filter((v) => v.name !== config.sharedVolumeName);
|
|
120
|
-
// Update app containers to remove volume mounts and DD_* env vars
|
|
121
|
-
updatedContainers = updatedContainers.map((c) => this.updateAppContainer(c, config));
|
|
122
|
-
// Remove DD_API_KEY secret
|
|
123
|
-
const secrets = (_e = (_d = containerApp.configuration) === null || _d === void 0 ? void 0 : _d.secrets) !== null && _e !== void 0 ? _e : [];
|
|
124
|
-
const updatedSecrets = secrets.filter((secret) => secret.name !== common_2.DD_API_KEY_SECRET_NAME);
|
|
125
|
-
return Object.assign(Object.assign({}, containerApp), { configuration: Object.assign(Object.assign({}, containerApp.configuration), { secrets: updatedSecrets }), template: Object.assign(Object.assign({}, containerApp.template), { containers: updatedContainers, volumes: updatedVolumes }) });
|
|
126
|
-
}
|
|
127
|
-
// Remove volume mount, DD_* env vars, and custom env vars
|
|
128
|
-
updateAppContainer(appContainer, config) {
|
|
129
|
-
const existingVolumeMounts = appContainer.volumeMounts || [];
|
|
130
|
-
const updatedVolumeMounts = existingVolumeMounts.filter((v) => v.volumeName !== config.sharedVolumeName);
|
|
131
|
-
const customEnvVars = (0, common_1.parseEnvVars)(config.envVars);
|
|
132
|
-
const existingEnvVars = appContainer.env || [];
|
|
133
|
-
// Remove env vars beginning with DD_ and custom env vars
|
|
134
|
-
const updatedEnvVars = existingEnvVars.filter((v) => v.name && !v.name.startsWith('DD_') && !(v.name in customEnvVars));
|
|
135
|
-
return Object.assign(Object.assign({}, appContainer), { volumeMounts: updatedVolumeMounts, env: updatedEnvVars });
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.PluginCommand = PluginCommand;
|
|
139
|
-
//# sourceMappingURL=uninstrument.js.map
|
|
1
|
+
"use strict"
|
|
2
|
+
module.exports = require("../bundle.js").commands["uninstrument"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/datadog-ci-plugin-container-app",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "Datadog CI plugin for `container-app` commands",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -14,15 +14,25 @@
|
|
|
14
14
|
"url": "https://github.com/DataDog/datadog-ci.git",
|
|
15
15
|
"directory": "packages/plugin-container-app"
|
|
16
16
|
},
|
|
17
|
+
"main": "dist/bundle.js",
|
|
18
|
+
"types": "dist/bundle.d.ts",
|
|
17
19
|
"exports": {
|
|
18
20
|
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/bundle.d.ts",
|
|
23
|
+
"default": "./dist/bundle.js"
|
|
24
|
+
},
|
|
19
25
|
"./commands/*": {
|
|
20
26
|
"development": "./src/commands/*.ts",
|
|
21
27
|
"default": "./dist/commands/*.js"
|
|
22
28
|
}
|
|
23
29
|
},
|
|
24
30
|
"files": [
|
|
25
|
-
"dist
|
|
31
|
+
"dist/bundle.js",
|
|
32
|
+
"dist/bundle.js.map",
|
|
33
|
+
"dist/bundle.js.LEGAL.txt",
|
|
34
|
+
"dist/bundle.d.ts",
|
|
35
|
+
"dist/commands/*.js",
|
|
26
36
|
"README",
|
|
27
37
|
"LICENSE"
|
|
28
38
|
],
|
|
@@ -32,15 +42,13 @@
|
|
|
32
42
|
"scripts": {
|
|
33
43
|
"build": "yarn package:clean; yarn package:build",
|
|
34
44
|
"lint": "yarn package:lint",
|
|
35
|
-
"prepack": "yarn package:clean-dist"
|
|
45
|
+
"prepack": "yarn package:clean-dist; yarn package:bundle:npm"
|
|
36
46
|
},
|
|
37
|
-
"
|
|
38
|
-
"@datadog/datadog-ci-base": "5.12.1"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
47
|
+
"devDependencies": {
|
|
41
48
|
"@azure/arm-appcontainers": "3.0.0",
|
|
42
49
|
"@azure/arm-resources": "6.1.0",
|
|
43
50
|
"@azure/identity": "4.10.1",
|
|
51
|
+
"@datadog/datadog-ci-base": "5.13.0",
|
|
44
52
|
"chalk": "3.0.0"
|
|
45
53
|
}
|
|
46
54
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ContainerApp } from '@azure/arm-appcontainers';
|
|
2
|
-
import type { ContainerAppConfigOptions } from '@datadog/datadog-ci-base/commands/container-app/common';
|
|
3
|
-
import { ContainerAppsAPIClient } from '@azure/arm-appcontainers';
|
|
4
|
-
import { ContainerAppInstrumentCommand } from '@datadog/datadog-ci-base/commands/container-app/instrument';
|
|
5
|
-
export declare class PluginCommand extends ContainerAppInstrumentCommand {
|
|
6
|
-
private cred;
|
|
7
|
-
private tagClient;
|
|
8
|
-
execute(): Promise<0 | 1>;
|
|
9
|
-
processSubscription(subscriptionId: string, resourceGroupToNames: Record<string, string[]>, config: ContainerAppConfigOptions): Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Process an Azure Container App for instrumentation.
|
|
12
|
-
* @returns A promise that resolves to a boolean indicating success or failure.
|
|
13
|
-
*/
|
|
14
|
-
processContainerApp(containerAppClient: ContainerAppsAPIClient, config: ContainerAppConfigOptions, resourceGroup: string, containerAppName: string): Promise<boolean>;
|
|
15
|
-
addTags(config: ContainerAppConfigOptions, subscriptionId: string, resourceGroup: string, containerApp: ContainerApp): Promise<void>;
|
|
16
|
-
instrumentSidecar(client: ContainerAppsAPIClient, config: ContainerAppConfigOptions, resourceGroup: string, containerApp: ContainerApp): Promise<void>;
|
|
17
|
-
createInstrumentedAppConfig(config: ContainerAppConfigOptions, subscriptionId: string, resourceGroup: string, containerApp: ContainerApp): ContainerApp;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file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AW,EAAC,CAAC,CAAC,CAAC,MAAM,CACjH,CAAA;QACD,IAAI,CAAC,SAAS,EAAE;YACd,cAAc,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,+BAAsB,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,UAAW,EAAC,CAAC,CAAA;SACpF;QAED,uCACK,YAAY,KACf,aAAa,kCAAM,YAAY,CAAC,aAAa,KAAE,OAAO,EAAE,cAAc,KACtE,QAAQ,EAAE,eAAe,IAC1B;IACH,CAAC;CACF;AA3OD,sCA2OC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ContainerApp } from '@azure/arm-appcontainers';
|
|
2
|
-
import type { ContainerAppConfigOptions } from '@datadog/datadog-ci-base/commands/container-app/common';
|
|
3
|
-
import { ContainerAppsAPIClient } from '@azure/arm-appcontainers';
|
|
4
|
-
import { ContainerAppUninstrumentCommand } from '@datadog/datadog-ci-base/commands/container-app/uninstrument';
|
|
5
|
-
export declare class PluginCommand extends ContainerAppUninstrumentCommand {
|
|
6
|
-
private cred;
|
|
7
|
-
private tagClient;
|
|
8
|
-
execute(): Promise<0 | 1>;
|
|
9
|
-
processSubscription(subscriptionId: string, resourceGroupToNames: Record<string, string[]>, config: ContainerAppConfigOptions): Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Process an Azure Container App for uninstrumentation.
|
|
12
|
-
* @returns A promise that resolves to a boolean indicating success or failure.
|
|
13
|
-
*/
|
|
14
|
-
processContainerApp(containerAppClient: ContainerAppsAPIClient, config: ContainerAppConfigOptions, resourceGroup: string, containerAppName: string, subscriptionId: string): Promise<boolean>;
|
|
15
|
-
removeTags(subscriptionId: string, resourceGroup: string, containerApp: ContainerApp): Promise<void>;
|
|
16
|
-
uninstrumentSidecar(client: ContainerAppsAPIClient, config: ContainerAppConfigOptions, resourceGroup: string, containerApp: ContainerApp): Promise<void>;
|
|
17
|
-
createUninstrumentedAppConfig(config: ContainerAppConfigOptions, containerApp: ContainerApp): ContainerApp;
|
|
18
|
-
private updateAppContainer;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uninstrument.js","sourceRoot":"","sources":["../../src/commands/uninstrument.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,gEAA+D;AAC/D,wDAA6D;AAC7D,8CAAsD;AACtD,+FAA4G;AAC5G,wEAAwF;AACxF,6EAA8F;AAC9F,+EAAmG;AACnG,gEAAqF;AACrF,kDAAyB;AAEzB,sCAAgD;AAEhD,MAAa,aAAc,SAAQ,8CAA+B;IAInD,OAAO;;YAClB,IAAI,CAAC,UAAU,EAAE,CAAA;YACjB,MAAM,CAAC,2BAA2B,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;YAC/E,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;gBACrB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;oBAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAA;iBAC9C;gBAED,OAAO,CAAC,CAAA;aACT;YAED,IAAI,CAAC,IAAI,GAAG,IAAI,iCAAsB,EAAE,CAAA;YACxC,IAAI,CAAC,CAAC,MAAM,IAAA,uBAAe,EAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;gBAChF,OAAO,CAAC,CAAA;aACT;YACD,IAAI,CAAC,SAAS,GAAG,IAAI,wCAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,cAAc,CAAA;YAEvE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,YAAY,4DAA4D,CAAC,CAAA;YAC3G,MAAM,OAAO,GAAG,MAAM,OAAO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AM,oBAAoB,GAAG,YAAY,CAAC,YAAY,IAAI,EAAE,CAAA;QAC5D,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,MAAM,CACrD,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,gBAAgB,CAC7D,CAAA;QAED,MAAM,aAAa,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAElD,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,IAAI,EAAE,CAAA;QAC9C,yDAAyD;QACzD,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAC3C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,aAAa,CAAC,CACzE,CAAA;QAED,uCACK,YAAY,KACf,YAAY,EAAE,mBAAmB,EACjC,GAAG,EAAE,cAAc,IACpB;IACH,CAAC;CACF;AAxLD,sCAwLC"}
|
package/dist/common.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EnvironmentVar } from '@azure/arm-appcontainers';
|
|
2
|
-
import type { ContainerAppConfigOptions } from '@datadog/datadog-ci-base/commands/container-app/common';
|
|
3
|
-
export declare const DD_API_KEY_SECRET_NAME = "dd-api-key";
|
|
4
|
-
export declare const getEnvVarsByName: (config: ContainerAppConfigOptions, subscriptionId: string, resourceGroup: string) => Record<string, EnvironmentVar>;
|
package/dist/common.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnvVarsByName = exports.DD_API_KEY_SECRET_NAME = void 0;
|
|
4
|
-
const common_1 = require("@datadog/datadog-ci-base/helpers/serverless/common");
|
|
5
|
-
exports.DD_API_KEY_SECRET_NAME = 'dd-api-key';
|
|
6
|
-
const getEnvVarsByName = (config, subscriptionId, resourceGroup) => {
|
|
7
|
-
// Get base environment variables
|
|
8
|
-
const envVars = Object.fromEntries(Object.entries((0, common_1.getBaseEnvVars)(config)).map(([name, value]) => [name, { name, value }]));
|
|
9
|
-
// special case for DD_API_KEY where we use a secret
|
|
10
|
-
delete envVars.DD_API_KEY.value;
|
|
11
|
-
envVars.DD_API_KEY.secretRef = exports.DD_API_KEY_SECRET_NAME;
|
|
12
|
-
envVars.DD_AZURE_SUBSCRIPTION_ID = { name: 'DD_AZURE_SUBSCRIPTION_ID', value: subscriptionId };
|
|
13
|
-
envVars.DD_AZURE_RESOURCE_GROUP = { name: 'DD_AZURE_RESOURCE_GROUP', value: resourceGroup };
|
|
14
|
-
envVars.DD_SERVERLESS_LOG_PATH = { name: 'DD_SERVERLESS_LOG_PATH', value: config.logsPath };
|
|
15
|
-
return envVars;
|
|
16
|
-
};
|
|
17
|
-
exports.getEnvVarsByName = getEnvVarsByName;
|
|
18
|
-
//# sourceMappingURL=common.js.map
|
package/dist/common.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AAEpE,QAAA,sBAAsB,GAAG,YAAY,CAAA;AAE3C,MAAM,gBAAgB,GAAG,CAC9B,MAAiC,EACjC,cAAsB,EACtB,aAAqB,EACW,EAAE;IAClC,iCAAiC;IACjC,MAAM,OAAO,GAAmC,MAAM,CAAC,WAAW,CAChE,MAAM,CAAC,OAAO,CAAC,IAAA,uBAAc,EAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,CACrF,CAAA;IAED,oDAAoD;IACpD,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,CAAA;IAC/B,OAAO,CAAC,UAAU,CAAC,SAAS,GAAG,8BAAsB,CAAA;IAErD,OAAO,CAAC,wBAAwB,GAAG,EAAC,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,cAAc,EAAC,CAAA;IAC5F,OAAO,CAAC,uBAAuB,GAAG,EAAC,IAAI,EAAE,yBAAyB,EAAE,KAAK,EAAE,aAAa,EAAC,CAAA;IACzF,OAAO,CAAC,sBAAsB,GAAG,EAAC,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAC,CAAA;IAEzF,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAnBY,QAAA,gBAAgB,oBAmB5B"}
|