@datadog/datadog-ci-plugin-container-app 4.2.1 → 4.3.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/README.md
CHANGED
|
@@ -117,13 +117,15 @@ You can pass the following arguments to `instrument` to specify its behavior. Th
|
|
|
117
117
|
| `--service` | | The value for the service tag. Use this to group related Container Apps belonging to similar workloads. For example, `my-service`. If not provided, the Container App name is used. | |
|
|
118
118
|
| `--env` or `--environment` | | The value for the env tag. Use this to separate your staging, development, and production environments. For example, `prod`. | |
|
|
119
119
|
| `--version` | | The value for the version tag. Use this to correlate spikes in latency, load, or errors to new versions. For example, `1.0.0`. | |
|
|
120
|
-
| `--sidecar-name` | | (Not recommended) The name to use for the sidecar container. | `
|
|
121
|
-
| `--shared-volume-name` | | (Not recommended) Specify a custom shared volume name. | `
|
|
122
|
-
| `--shared-volume-path` | | (Not recommended) Specify a custom shared volume path. | `
|
|
123
|
-
| `--logs-path` | | (Not recommended) Specify a custom log file path. Must begin with the shared volume path. | `
|
|
120
|
+
| `--sidecar-name` | | (Not recommended) The name to use for the sidecar container. | `datadog-sidecar` |
|
|
121
|
+
| `--shared-volume-name` | | (Not recommended) Specify a custom shared volume name. | `shared-volume` |
|
|
122
|
+
| `--shared-volume-path` | | (Not recommended) Specify a custom shared volume path. | `/shared-volume` |
|
|
123
|
+
| `--logs-path` | | (Not recommended) Specify a custom log file path. Must begin with the shared volume path. | `/shared-volume/logs/*.log` |
|
|
124
|
+
| `--sidecar-cpu` | | The number of CPUs to allocate to the sidecar container. | `0.5` |
|
|
125
|
+
| `--sidecar-memory` | | The amount of memory (in GiB) to allocate to the sidecar container. | `1` |
|
|
124
126
|
| `--source-code-integration` or `--sourceCodeIntegration` | | Whether to enable the Datadog Source Code integration. This tags your service(s) with the Git repository and the latest commit hash of the local directory. Specify `--no-source-code-integration` to disable. | `true` |
|
|
125
127
|
| `--upload-git-metadata` or `--uploadGitMetadata` | | Whether to enable Git metadata uploading, as a part of the source code integration. Git metadata uploading is only required if you don't have the Datadog GitHub integration installed. Specify `--no-upload-git-metadata` to disable. | `true` |
|
|
126
|
-
| `--extra-tags` or `--extraTags` | | Additional tags to add to the
|
|
128
|
+
| `--extra-tags` or `--extraTags` | | Additional tags to add to the app in the format "key1:value1,key2:value2". | |
|
|
127
129
|
<!-- END_USAGE:instrument -->
|
|
128
130
|
|
|
129
131
|
#### `uninstrument`
|
|
@@ -139,8 +141,8 @@ You can pass the following arguments to `uninstrument` to specify its behavior.
|
|
|
139
141
|
| `--env-vars` | `-e` | Additional environment variables to set for the Container App. Can specify multiple variables in the format `--env-vars VAR1=VALUE1 --env-vars VAR2=VALUE2`. | |
|
|
140
142
|
| `--config` | | Path to the configuration file. | |
|
|
141
143
|
| `--dry-run` | `-d` | Run the command in dry-run mode, without making any changes. Preview the changes that running the command would apply. | `false` |
|
|
142
|
-
| `--sidecar-name` | | The name of the sidecar container to remove. Specify if you have a different sidecar name. | `
|
|
143
|
-
| `--shared-volume-name` | | The name of the shared volume to remove. Specify if you have a different shared volume name. | `
|
|
144
|
+
| `--sidecar-name` | | The name of the sidecar container to remove. Specify if you have a different sidecar name. | `datadog-sidecar` |
|
|
145
|
+
| `--shared-volume-name` | | The name of the shared volume to remove. Specify if you have a different shared volume name. | `shared-volume` |
|
|
144
146
|
<!-- END_USAGE:uninstrument -->
|
|
145
147
|
|
|
146
148
|
### Configuration file
|
|
@@ -137,15 +137,15 @@ class PluginCommand extends instrument_1.ContainerAppInstrumentCommand {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
createInstrumentedAppConfig(config, subscriptionId, resourceGroup, containerApp) {
|
|
140
|
-
var _a, _b, _c;
|
|
140
|
+
var _a, _b, _c, _d, _e;
|
|
141
141
|
const envVarsByName = (0, common_2.getEnvVarsByName)(config, subscriptionId, resourceGroup);
|
|
142
142
|
// Build base sidecar container
|
|
143
143
|
const baseSidecar = {
|
|
144
144
|
name: config.sidecarName,
|
|
145
145
|
image: constants_2.SIDECAR_IMAGE,
|
|
146
146
|
resources: {
|
|
147
|
-
cpu: 0.
|
|
148
|
-
memory:
|
|
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
149
|
},
|
|
150
150
|
probes: [
|
|
151
151
|
{
|
|
@@ -161,13 +161,13 @@ class PluginCommand extends instrument_1.ContainerAppInstrumentCommand {
|
|
|
161
161
|
],
|
|
162
162
|
};
|
|
163
163
|
// Use shared helper to create instrumented template
|
|
164
|
-
const updatedTemplate = (0, common_1.createInstrumentedTemplate)((
|
|
164
|
+
const updatedTemplate = (0, common_1.createInstrumentedTemplate)((_c = containerApp.template) !== null && _c !== void 0 ? _c : {}, baseSidecar, {
|
|
165
165
|
name: config.sharedVolumeName,
|
|
166
166
|
mountPath: config.sharedVolumePath,
|
|
167
167
|
mountOptions: { storageType: 'EmptyDir' },
|
|
168
168
|
volumeMountNameKey: 'volumeName',
|
|
169
169
|
}, envVarsByName);
|
|
170
|
-
const secrets = (
|
|
170
|
+
const secrets = (_e = (_d = containerApp.configuration) === null || _d === void 0 ? void 0 : _d.secrets) !== null && _e !== void 0 ? _e : [];
|
|
171
171
|
const hasApiKey = secrets.some(({ name }) => name === common_2.DD_API_KEY_SECRET_NAME);
|
|
172
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
173
|
if (!hasApiKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../src/commands/instrument.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAgG;AAChG,wDAA6E;AAC7E,8CAAsD;AAEtD,
|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AAsB,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,UAAW,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/datadog-ci-plugin-container-app",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Datadog CI plugin for `container-app` commands",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prepack": "yarn package:clean-dist"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@datadog/datadog-ci-base": "4.
|
|
38
|
+
"@datadog/datadog-ci-base": "4.3.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@azure/arm-appcontainers": "^3.0.0",
|