Skip to content

Commit

Permalink
fix: expose gRPC methods on server
Browse files Browse the repository at this point in the history
  • Loading branch information
fra98 committed Nov 4, 2024
1 parent e72e912 commit 811882a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/liqo-controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ func main() {
var ipamClient ipam.IpamClient
if *ipamServer != "" {
klog.Infof("connecting to the IPAM server %q", *ipamServer)
connection, err := grpc.NewClient(*ipamServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(*ipamServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
klog.Errorf("failed to establish a connection to the IPAM %q", *ipamServer)
os.Exit(1)
}
ipamClient = ipam.NewIpamClient(connection)
defer conn.Close()
ipamClient = ipam.NewIpamClient(conn)
}

if err := modules.SetupNetworkingModule(ctx, mgr, &modules.NetworkingOption{
Expand Down
25 changes: 25 additions & 0 deletions pkg/ipam/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,28 @@ func New(ctx context.Context, opts *Options) (*LiqoIPAM, error) {
opts.HealthServer.SetServingStatus(IPAM_ServiceDesc.ServiceName, grpc_health_v1.HealthCheckResponse_SERVING)
return lipam, nil
}

// IPAcquire acquires a free IP from a given CIDR.
func (lipam *LiqoIPAM) IPAcquire(_ context.Context, _ *IPAcquireRequest) (*IPAcquireResponse, error) {
panic("implement me")
}

// IPRelease releases an IP from a given CIDR.
func (lipam *LiqoIPAM) IPRelease(_ context.Context, _ *IPReleaseRequest) (*IPReleaseResponse, error) {
panic("implement me")
}

// NetworkAcquire acquires a network. If it is already reserved, it allocates and reserves a new free one with the same prefix length.
func (lipam *LiqoIPAM) NetworkAcquire(_ context.Context, _ *NetworkAcquireRequest) (*NetworkAcquireResponse, error) {
panic("implement me")
}

// NetworkRelease releases a network.
func (lipam *LiqoIPAM) NetworkRelease(_ context.Context, _ *NetworkReleaseRequest) (*NetworkReleaseResponse, error) {
panic("implement me")
}

// NetworkIsAvailable checks if a network is available.
func (lipam *LiqoIPAM) NetworkIsAvailable(_ context.Context, _ *NetworkAvailableRequest) (*NetworkAvailableResponse, error) {
panic("implement me")
}

0 comments on commit 811882a

Please sign in to comment.