@@ -32,8 +32,17 @@ func (d *DriverClient) Validate(ctx context.Context) error {
3232 return nil
3333}
3434
35- func (d * DriverClient ) Create (_ context.Context ) error {
36- return errors .New ("create not implemented for external drivers" )
35+ func (d * DriverClient ) Create (ctx context.Context ) error {
36+ d .logger .Debug ("Initializing driver instance" )
37+
38+ _ , err := d .DriverSvc .Create (ctx , & emptypb.Empty {})
39+ if err != nil {
40+ d .logger .Errorf ("Initialization failed: %v" , err )
41+ return err
42+ }
43+
44+ d .logger .Debug ("Driver instance initialized successfully" )
45+ return nil
3746}
3847
3948func (d * DriverClient ) CreateDisk (ctx context.Context ) error {
@@ -93,8 +102,17 @@ func (d *DriverClient) Stop(ctx context.Context) error {
93102 return nil
94103}
95104
96- func (d * DriverClient ) Delete (_ context.Context ) error {
97- return errors .New ("delete not implemented for external drivers" )
105+ func (d * DriverClient ) Delete (ctx context.Context ) error {
106+ d .logger .Debug ("Deleting driver instance" )
107+
108+ _ , err := d .DriverSvc .Delete (ctx , & emptypb.Empty {})
109+ if err != nil {
110+ d .logger .Errorf ("Failed to delete driver instance: %v" , err )
111+ return err
112+ }
113+
114+ d .logger .Debug ("Driver instance deleted successfully" )
115+ return nil
98116}
99117
100118func (d * DriverClient ) AcceptConfig (_ * limatype.LimaYAML , _ string ) error {
@@ -239,7 +257,7 @@ func (d *DriverClient) Info() driver.Info {
239257 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
240258 defer cancel ()
241259
242- resp , err := d .DriverSvc .GetInfo (ctx , & emptypb.Empty {})
260+ resp , err := d .DriverSvc .Info (ctx , & emptypb.Empty {})
243261 if err != nil {
244262 d .logger .Errorf ("Failed to get driver info: %v" , err )
245263 return driver.Info {}
@@ -267,7 +285,7 @@ func (d *DriverClient) Configure(inst *limatype.Instance) *driver.ConfiguredDriv
267285 ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
268286 defer cancel ()
269287
270- _ , err = d .DriverSvc .SetConfig (ctx , & pb.SetConfigRequest {
288+ _ , err = d .DriverSvc .Configure (ctx , & pb.SetConfigRequest {
271289 InstanceConfigJson : instJSON ,
272290 })
273291 if err != nil {
@@ -285,10 +303,27 @@ func (d *DriverClient) InspectStatus(_ context.Context, _ *limatype.Instance) st
285303 return ""
286304}
287305
288- func (d * DriverClient ) SSHAddress (_ context.Context ) (string , error ) {
289- return "" , errors .New ("sshAddress not implemented for external drivers" )
306+ func (d * DriverClient ) SSHAddress (ctx context.Context ) (string , error ) {
307+ d .logger .Debug ("Getting SSH address for the driver instance" )
308+
309+ resp , err := d .DriverSvc .SSHAddress (ctx , & emptypb.Empty {})
310+ if err != nil {
311+ d .logger .Errorf ("Failed to get SSH address: %v" , err )
312+ return "" , err
313+ }
314+
315+ d .logger .Debugf ("SSH address retrieved: %s" , resp .Address )
316+ return resp .Address , nil
290317}
291318
292319func (d * DriverClient ) BootScripts () (map [string ][]byte , error ) {
293- return nil , errors .New ("bootScripts not implemented for external drivers" )
320+ d .logger .Debug ("Getting boot scripts for the driver instance" )
321+ resp , err := d .DriverSvc .BootScripts (context .Background (), & emptypb.Empty {})
322+ if err != nil {
323+ d .logger .Errorf ("Failed to get boot scripts: %v" , err )
324+ return nil , err
325+ }
326+
327+ d .logger .Debugf ("Boot scripts retrieved successfully: %d scripts" , len (resp .Scripts ))
328+ return resp .Scripts , nil
294329}
0 commit comments