Skip to content

Commit

Permalink
Remove VtMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
krhitesh7 committed Aug 23, 2024
1 parent 7823ec8 commit 84600a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions pkg/cache/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
// Resource is the base interface for the xDS payload.
type Resource interface {
proto.Message
}

type VtResource interface {
MarshalVTStrict() ([]byte, error)
}

Expand Down
10 changes: 1 addition & 9 deletions pkg/cache/v3/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
runtime "github.com/envoyproxy/go-control-plane/envoy/service/runtime/v3"
"github.com/envoyproxy/go-control-plane/pkg/cache/types"
"github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"google.golang.org/protobuf/proto"
)

// GetResponseType returns the enumeration for a valid xDS type URL.
Expand Down Expand Up @@ -124,14 +123,7 @@ func GetResourceWithTTLNames(resources []types.ResourceWithTTL) []string {

// MarshalResource converts the Resource to MarshaledResource.
func MarshalResource(resource types.Resource) (types.MarshaledResource, error) {
switch v := resource.(type) {
case types.VtResource:
return v.MarshalVTStrict()
case types.Resource:
return proto.MarshalOptions{Deterministic: true}.Marshal(v)
default:
return nil, fmt.Errorf("failed to marshal, message is %T, must satisfy the vtprotoMessage interface or want proto.Message", v)
}
return resource.MarshalVTStrict()
}

// GetResourceReferences returns a map of dependent resources keyed by resource type, given a map of resources.
Expand Down

0 comments on commit 84600a0

Please sign in to comment.