Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
The `@pulumi/policy` library was updated to support remediations, but this repo hasn't been updated since then. This commit fixes some compile errors due to the changes there.

Note: This points out that we're missing a daily cron in this repro to catch these things sooner.
  • Loading branch information
justinvp committed Jan 29, 2024
1 parent e6a7fbb commit ec60c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/enforcementLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function isEnforcementLevel(o: any): o is EnforcementLevel {
case "advisory":
case "disabled":
case "mandatory":
case "remediate":
return true;
default:
return exhaustiveFalse(enforcementLevel);
Expand Down
3 changes: 3 additions & 0 deletions src/tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ async function runResourcePolicy(resPolicy: policy.ResourceValidationPolicy, arg
? resPolicy.validateResource
: [resPolicy.validateResource];
for (const validation of validations) {
if (!validation) {
throw Error("validateResource must be a function or array of functions.");
}
await Promise.resolve(validation(args, report));
}
return violations;
Expand Down

0 comments on commit ec60c93

Please sign in to comment.