Skip to content

Commit

Permalink
Change XCustomCheck to PreCheckCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Aug 1, 2023
1 parent ab12a94 commit 1edb7d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pf/tfbridge/provider_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (p *provider) CheckWithContext(
}

if info := rh.pulumiResourceInfo; info != nil {
if check := info.XCustomCheck; check != nil {
if check := info.PreCheckCallback; check != nil {
checkedInputs, err := check(ctx, checkedInputs, p.lastKnownProviderConfig.Copy())
if err != nil {
return checkedInputs, []plugin.CheckFailure{}, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/tfbridge/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ type ResourceInfo struct {
PreStateUpgradeHook PreStateUpgradeHook

// An experimental way to augment the Check function in the Pulumi life cycle.
XCustomCheck XCustomCheck
PreCheckCallback PreCheckCallback
}

type XCustomCheck = func(
type PreCheckCallback = func(
ctx context.Context, config resource.PropertyMap, meta resource.PropertyMap,
) (resource.PropertyMap, error)

Expand Down
2 changes: 1 addition & 1 deletion pkg/tfbridge/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ func (p *Provider) Check(ctx context.Context, req *pulumirpc.CheckRequest) (*pul
return nil, err
}

if check := res.Schema.XCustomCheck; check != nil {
if check := res.Schema.PreCheckCallback; check != nil {
news, err = check(ctx, news, p.configValues.Copy())
if err != nil {
return nil, err
Expand Down

0 comments on commit 1edb7d8

Please sign in to comment.