Skip to content

Commit 687b648

Browse files
committed
fix: expose gRPC methods on server
1 parent 4fd7922 commit 687b648

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

cmd/liqo-controller-manager/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func main() {
152152
// OFFLOADING MODULE
153153
// Storage Provisioner parameters
154154
enableStorage := pflag.Bool("enable-storage", false, "enable the liqo virtual storage class")
155-
virtualStorageClassName := pflag.String("virtual-storage-class-name", consts.DefaultLiqoNamespace, "Name of the virtual storage class")
155+
virtualStorageClassName := pflag.String("virtual-storage-class-name", "liqo", "Name of the virtual storage class")
156156
realStorageClassName := pflag.String("real-storage-class-name", "", "Name of the real storage class to use for the actual volumes")
157157
storageNamespace := pflag.String("storage-namespace", "liqo-storage", "Namespace where the liqo storage-related resources are stored")
158158
// Service continuity
@@ -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)