Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly copy over secret environment variables #4543

Merged
merged 4 commits into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
- Fixes bug where secret environment variables were not set on functions (#4543)
17 changes: 8 additions & 9 deletions src/deploy/functions/runtimes/discovery/v1alpha1.ts
Expand Up @@ -250,16 +250,15 @@ function parseEndpoints(
"secretEnvironmentVariables",
"secretEnvironmentVariables",
(senvs: ManifestEndpoint["secretEnvironmentVariables"]) => {
if (senvs && senvs.length > 0) {
ep.secretEnvironmentVariables = [];
for (const { key, secret } of senvs) {
ep.secretEnvironmentVariables.push({
key,
secret: secret || key, // if secret is undefined, assume env var key == secret name
projectId: project,
});
}
const secretEnvironmentVariables: backend.SecretEnvVar[] = [];
for (const { key, secret } of senvs!) {
secretEnvironmentVariables.push({
key,
secret: secret || key, // if secret is undefined, assume env var key == secret name
projectId: project,
});
}
return secretEnvironmentVariables;
inlined marked this conversation as resolved.
Show resolved Hide resolved
}
);
allParsed.push(parsed);
Expand Down