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

Remove deprecated validateTypedResource helper #227

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 0.5.0 (2020-04-01)
## HEAD (Unreleased)

- Remove deprecated `validateTypedResource` helper. Use `validateResourceOfType` instead.
(https://github.com/pulumi/pulumi-policy/pull/227).

### Improvements
## 0.5.0 (2020-04-01)

- Expose options, parent, dependencies, and provider config (https://github.com/pulumi/pulumi-policy/pull/184).

Expand Down Expand Up @@ -65,8 +68,6 @@

## 0.4.0 (2020-01-30)

### Improvements

- Add support for using `Config`, `getProject()`, `getStack()`, and `isDryRun()` from Policy Packs
via upgraded dependency on `@pulumi/pulumi` v1.8.0 (requires v1.8.0 or later of the Pulumi SDK) (https://github.com/pulumi/pulumi-policy/pull/169).

Expand Down Expand Up @@ -94,17 +95,13 @@

## 0.3.0 (2019-11-26)

### Improvements

- Add `"disabled"` to `EnforcementLevel` to disable policies
(https://github.com/pulumi/pulumi-policy/pull/156).
- Add resource `urn` and `name` properties along with support for reporting the URN associated with
a stack validation policy violation (https://github.com/pulumi/pulumi-policy/pull/151).

## 0.2.0 (2019-11-13)

### Improvements

- API changes to enable new types of policies (i.e. validating all resource in a stack) and passing
additional information to validation functions (https://github.com/pulumi/pulumi-policy/pull/131).

Expand Down Expand Up @@ -134,20 +131,14 @@
});
```

### Bug fixes

- Allow policies to deal with Pulumi secret values
(https://github.com/pulumi/pulumi-policy/pull/115).

## 0.1.1

### Improvements

- Make policy violation error messages two lines (https://github.com/pulumi/pulumi-policy/pull/95).
- Fix polarity issue in policy violation reports (https://github.com/pulumi/pulumi-policy/pull/95).

## 0.1.0

### Major Changes

- Add initial Policy server.
19 changes: 0 additions & 19 deletions sdk/nodejs/policy/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,25 +385,6 @@ export function validateResourceOfType<TResource extends Resource, TArgs>(
};
}

/**
* A helper function that returns a strongly-typed resource validation function, used to check only resources of the
* specified resource class.
*
* @param resourceClass Used to filter this check to only resources of the specified resource class.
* @param validate A callback function that validates if the resource definition violates a policy.
*
* @deprecated This is deprecated and will be removed in a future version. Use `validateResourceOfType` instead.
*/
export function validateTypedResource<TResource extends Resource, TArgs>(
resourceClass: { new(name: string, args: TArgs, ...rest: any[]): TResource },
validate: (
props: Unwrap<NonNullable<TArgs>>,
args: ResourceValidationArgs,
reportViolation: ReportViolation) => Promise<void> | void,
): ResourceValidation {
return validateResourceOfType(resourceClass, validate);
}

/**
* StackValidationPolicy is a policy that validates a stack.
*/
Expand Down