Skip to content

Commit

Permalink
allow nil data writes for resources
Browse files Browse the repository at this point in the history
  • Loading branch information
skpratt committed Sep 15, 2023
1 parent 0b8e409 commit ab3e3bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
4 changes: 1 addition & 3 deletions agent/grpc-external/services/resource/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *Server) Write(ctx context.Context, req *pbresource.WriteRequest) (*pbre
}

// Check the user sent the correct type of data.
if !req.Resource.Data.MessageIs(reg.Proto) {
if req.Resource.Data != nil && !req.Resource.Data.MessageIs(reg.Proto) {
got := strings.TrimPrefix(req.Resource.Data.TypeUrl, "type.googleapis.com/")

return nil, status.Errorf(
Expand Down Expand Up @@ -272,8 +272,6 @@ func (s *Server) validateWriteRequest(req *pbresource.WriteRequest) (*resource.R
field = "resource"
case req.Resource.Id == nil:
field = "resource.id"
case req.Resource.Data == nil:
field = "resource.data"
}

if field != "" {
Expand Down
10 changes: 0 additions & 10 deletions proto-public/pbauth/v1alpha1/computed_traffic_permission.proto

This file was deleted.

0 comments on commit ab3e3bb

Please sign in to comment.