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

Fix panic in Check function #462

Merged
merged 3 commits into from
Jan 20, 2023
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ func (p *dockerNativeProvider) Check(ctx context.Context, req *rpc.CheckRequest)
}

// add implicit resource to provider
inputs["build"].ObjectValue()["contextDigest"] = resource.NewStringProperty(contextDigest)
inputs["build"] = resource.NewObjectProperty(resource.PropertyMap{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would replace inputs["build"] if the user set it - are we overriding anything the user would input?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'oh!

Added a null check condition.

"contextDigest": resource.NewStringProperty(contextDigest),
})
//inputs["build"].ObjectValue()["contextDigest"] = resource.NewStringProperty(contextDigest)

inputStruct, err := plugin.MarshalProperties(inputs, plugin.MarshalOptions{
KeepUnknowns: true,
Expand Down