MCPcopy
hub / github.com/loft-sh/devpod / Create

Method Create

pkg/client/clientimplementation/machine_client.go:86–116  ·  view source on GitHub ↗
(ctx context.Context, options client.CreateOptions)

Source from the content-addressed store, hash-verified

84}
85
86func (s *machineClient) Create(ctx context.Context, options client.CreateOptions) error {
87 done := printStillRunningLogMessagePeriodically(s.log)
88 defer close(done)
89
90 writer := s.log.Writer(logrus.InfoLevel, false)
91 defer writer.Close()
92
93 // create a machine
94 s.log.Infof("Create machine '%s' with provider '%s'...", s.machine.ID, s.config.Name)
95 err := RunCommandWithBinaries(
96 ctx,
97 "create",
98 s.config.Exec.Create,
99 s.machine.Context,
100 nil,
101 s.machine,
102 s.devPodConfig.ProviderOptions(s.config.Name),
103 s.config,
104 nil,
105 nil,
106 writer,
107 writer,
108 s.log,
109 )
110 if err != nil {
111 return err
112 }
113
114 s.log.Donef("Successfully created machine '%s' with provider '%s'", s.machine.ID, s.config.Name)
115 return nil
116}
117
118func (s *machineClient) Start(ctx context.Context, options client.StartOptions) error {
119 done := printStillRunningLogMessagePeriodically(s.log)

Callers

nothing calls this directly

Calls 7

RunCommandWithBinariesFunction · 0.85
WriterMethod · 0.45
CloseMethod · 0.45
InfofMethod · 0.45
ProviderOptionsMethod · 0.45
DonefMethod · 0.45

Tested by

no test coverage detected