-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
When the `build` field is unset entirely, the Check function was panicking attempting to set the implicit `contextDigest` field. This PR properly constructs the `inputs["build"]` field as a `resource.NewObjectProperty`.
provider/provider.go
Outdated
@@ -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{ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
When the
build
field is unset entirely, the Check function waspanicking attempting to set the implicit
contextDigest
field.This PR properly constructs the
inputs["build"]
field as aresource.NewObjectProperty
.