@@ -324,7 +324,7 @@ func (s *workspaceClient) Unlock() {
324324 }
325325}
326326
327- func (s * workspaceClient ) Create (ctx context.Context , options client. CreateOptions ) error {
327+ func (s * workspaceClient ) Create (ctx context.Context ) error {
328328 s .m .Lock ()
329329 defer s .m .Unlock ()
330330
@@ -353,7 +353,7 @@ func (s *workspaceClient) Create(ctx context.Context, options client.CreateOptio
353353 }
354354
355355 // create the machine
356- return machineClient .Create (ctx , client. CreateOptions {} )
356+ return machineClient .Create (ctx )
357357}
358358
359359func (s * workspaceClient ) Delete (ctx context.Context , opt client.DeleteOptions ) error {
@@ -469,7 +469,7 @@ func (s *workspaceClient) isMachineRunning(ctx context.Context) (bool, error) {
469469 return false , nil
470470}
471471
472- func (s * workspaceClient ) Start (ctx context.Context , options client. StartOptions ) error {
472+ func (s * workspaceClient ) Start (ctx context.Context ) error {
473473 s .m .Lock ()
474474 defer s .m .Unlock ()
475475
@@ -482,7 +482,7 @@ func (s *workspaceClient) Start(ctx context.Context, options client.StartOptions
482482 return err
483483 }
484484
485- return machineClient .Start (ctx , options )
485+ return machineClient .Start (ctx )
486486}
487487
488488func (s * workspaceClient ) Stop (ctx context.Context , opt client.StopOptions ) error {
@@ -559,7 +559,7 @@ func (s *workspaceClient) Command(
559559func (s * workspaceClient ) Status (
560560 ctx context.Context ,
561561 options client.StatusOptions ,
562- ) (client. Status , error ) {
562+ ) (string , error ) {
563563 s .m .Lock ()
564564 defer s .m .Unlock ()
565565
@@ -609,6 +609,27 @@ func (s *workspaceClient) Status(
609609 return client .StatusNotFound , nil
610610}
611611
612+ func (s * workspaceClient ) Describe (ctx context.Context ) (string , error ) {
613+ s .m .Lock ()
614+ defer s .m .Unlock ()
615+
616+ // check if provider has 'describe' command
617+ if s .isMachineProvider () && len (s .config .Exec .Describe ) > 0 {
618+ if s .machine == nil {
619+ return client .DescriptionNotFound , nil
620+ }
621+
622+ machineClient , err := NewMachineClient (s .devPodConfig , s .config , s .machine , s .log )
623+ if err != nil {
624+ return client .DescriptionNotFound , err
625+ }
626+
627+ return machineClient .Describe (ctx )
628+ }
629+
630+ return client .DescriptionNotFound , nil
631+ }
632+
612633func (s * workspaceClient ) initLock () error {
613634 s .workspaceLockOnce .Do (func () {
614635 s .m .Lock ()
@@ -640,7 +661,7 @@ func (s *workspaceClient) initLock() error {
640661 return s .workspaceLockErr
641662}
642663
643- func (s * workspaceClient ) getContainerStatus (ctx context.Context ) (client. Status , error ) {
664+ func (s * workspaceClient ) getContainerStatus (ctx context.Context ) (string , error ) {
644665 stdout := & bytes.Buffer {}
645666 buf := & bytes.Buffer {}
646667 compressed , info , err := s .compressedAgentInfo (provider.CLIOptions {})
@@ -694,27 +715,6 @@ func (s *workspaceClient) getContainerStatus(ctx context.Context) (client.Status
694715 return parsed , nil
695716}
696717
697- func (s * workspaceClient ) Describe (ctx context.Context ) (string , error ) {
698- s .m .Lock ()
699- defer s .m .Unlock ()
700-
701- // check if provider has 'describe' command
702- if s .isMachineProvider () && len (s .config .Exec .Describe ) > 0 {
703- if s .machine == nil {
704- return client .DescriptionNotFound , nil
705- }
706-
707- machineClient , err := NewMachineClient (s .devPodConfig , s .config , s .machine , s .log )
708- if err != nil {
709- return client .DescriptionNotFound , err
710- }
711-
712- return machineClient .Describe (ctx )
713- }
714-
715- return client .DescriptionNotFound , nil
716- }
717-
718718func (s * workspaceClient ) isMachineProvider () bool {
719719 return len (s .config .Exec .Create ) > 0
720720}
@@ -933,7 +933,7 @@ func handleStoppedStatus(
933933 create bool ,
934934) error {
935935 if create {
936- err := workspaceClient .Start (ctx , client. StartOptions {} )
936+ err := workspaceClient .Start (ctx )
937937 if err != nil {
938938 return fmt .Errorf ("start workspace: %w" , err )
939939 }
@@ -948,7 +948,7 @@ func handleNotFoundStatus(
948948 create bool ,
949949) error {
950950 if create {
951- err := workspaceClient .Create (ctx , client. CreateOptions {} )
951+ err := workspaceClient .Create (ctx )
952952 if err != nil {
953953 return err
954954 }
0 commit comments