Skip to content

Commit 811882a

Browse files
committed
fix: expose gRPC methods on server
1 parent e72e912 commit 811882a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

cmd/liqo-controller-manager/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,13 @@ func main() {
251251
var ipamClient ipam.IpamClient
252252
if *ipamServer != "" {
253253
klog.Infof("connecting to the IPAM server %q", *ipamServer)
254-
connection, err := grpc.NewClient(*ipamServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
254+
conn, err := grpc.NewClient(*ipamServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
255255
if err != nil {
256256
klog.Errorf("failed to establish a connection to the IPAM %q", *ipamServer)
257257
os.Exit(1)
258258
}
259-
ipamClient = ipam.NewIpamClient(connection)
259+
defer conn.Close()
260+
ipamClient = ipam.NewIpamClient(conn)
260261
}
261262

262263
if err := modules.SetupNetworkingModule(ctx, mgr, &modules.NetworkingOption{

pkg/ipam/ipam.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,28 @@ func New(ctx context.Context, opts *Options) (*LiqoIPAM, error) {
6363
opts.HealthServer.SetServingStatus(IPAM_ServiceDesc.ServiceName, grpc_health_v1.HealthCheckResponse_SERVING)
6464
return lipam, nil
6565
}
66+
67+
// IPAcquire acquires a free IP from a given CIDR.
68+
func (lipam *LiqoIPAM) IPAcquire(_ context.Context, _ *IPAcquireRequest) (*IPAcquireResponse, error) {
69+
panic("implement me")
70+
}
71+
72+
// IPRelease releases an IP from a given CIDR.
73+
func (lipam *LiqoIPAM) IPRelease(_ context.Context, _ *IPReleaseRequest) (*IPReleaseResponse, error) {
74+
panic("implement me")
75+
}
76+
77+
// NetworkAcquire acquires a network. If it is already reserved, it allocates and reserves a new free one with the same prefix length.
78+
func (lipam *LiqoIPAM) NetworkAcquire(_ context.Context, _ *NetworkAcquireRequest) (*NetworkAcquireResponse, error) {
79+
panic("implement me")
80+
}
81+
82+
// NetworkRelease releases a network.
83+
func (lipam *LiqoIPAM) NetworkRelease(_ context.Context, _ *NetworkReleaseRequest) (*NetworkReleaseResponse, error) {
84+
panic("implement me")
85+
}
86+
87+
// NetworkIsAvailable checks if a network is available.
88+
func (lipam *LiqoIPAM) NetworkIsAvailable(_ context.Context, _ *NetworkAvailableRequest) (*NetworkAvailableResponse, error) {
89+
panic("implement me")
90+
}

0 commit comments

Comments
 (0)