Skip to content

Commit

Permalink
Enable secret manager API during ext:update (#5703)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj committed Apr 17, 2023
1 parent fd879c2 commit 8e82fe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
- firestore:locations
- Adds `extensions` as an option in `firebase init`.
- Relaxed repo URI validation in ext:dev:publish (#5698).
- Added Secret Manager API enablement during ext:install for extensions that use secrets (#5702).
- Enable Secret Manager API during ext:install/update for extensions that use secrets (#5702).
5 changes: 5 additions & 0 deletions src/commands/ext-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "../extensions/extensionsHelper";
import * as paramHelper from "../extensions/paramHelper";
import { inferUpdateSource } from "../extensions/updateHelper";
import * as secretsUtils from "../extensions/secretsUtils";
import * as refs from "../extensions/refs";
import { getProjectId } from "../projectUtils";
import { confirm } from "../prompt";
Expand Down Expand Up @@ -114,6 +115,10 @@ export const command = new Command("ext:update <extensionInstanceId> [updateSour
return;
}

if (secretsUtils.usesSecrets(newExtensionVersion.spec)) {
await secretsUtils.ensureSecretManagerApiEnabled(options);
}

const oldParamValues = manifest.readInstanceParam({
instanceId,
projectDir: config.projectDir,
Expand Down

0 comments on commit 8e82fe9

Please sign in to comment.