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

gRPC call for networkpolicy agent [only for main branch] #2785

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion pkg/rpcwrapper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
grpc "google.golang.org/grpc"
)

// RPC is the wrapper interface for the CNI gRPC backend client
// RPC is the wrapper interface for the CNI and network policy agent gRPC backend clients
type RPC interface {
NewCNIBackendClient(cc *grpc.ClientConn) rpc.CNIBackendClient
NewNPBackendClient(cc *grpc.ClientConn) rpc.NPBackendClient
}

type cniRPC struct{}
Expand All @@ -34,3 +35,7 @@ func New() RPC {
func (*cniRPC) NewCNIBackendClient(cc *grpc.ClientConn) rpc.CNIBackendClient {
return rpc.NewCNIBackendClient(cc)
}

func (*cniRPC) NewNPBackendClient(cc *grpc.ClientConn) rpc.NPBackendClient {
return rpc.NewNPBackendClient(cc)
}
26 changes: 20 additions & 6 deletions pkg/rpcwrapper/mocks/rpcwrapper_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rpc/generate_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
package rpc

//go:generate protoc --go_out=plugins=grpc,paths=source_relative:. rpc.proto
//go:generate go run github.com/golang/mock/mockgen -destination mocks/rpc_mocks.go -copyright_file ../scripts/copyright.txt . CNIBackendClient
//go:generate go run github.com/golang/mock/mockgen -destination mocks/rpc_mocks.go -copyright_file ../scripts/copyright.txt . CNIBackendClient,NPBackendClient
61 changes: 52 additions & 9 deletions rpc/mocks/rpc_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading