@@ -146,15 +146,11 @@ func (s *Stackit) Delete(ctx context.Context, projectId, machineName string) err
146146 }
147147
148148 networkId := nics [0 ].NetworkId
149- err = s .client . DeleteNetwork (ctx , projectId , * networkId ). Execute ( )
149+ err = s .deleteNetwork (ctx , projectId , * networkId )
150150 if err != nil {
151151 log .Default .Errorf ("failed to delete network" )
152152 gotError = true
153153 }
154- _ , err = wait .DeleteNetworkWaitHandler (ctx , s .client , projectId , * networkId ).WaitWithContext (ctx )
155- if err != nil {
156- log .Default .Errorf ("error while waiting for network deletion" )
157- }
158154
159155 for _ , id := range * nics [0 ].SecurityGroups {
160156 name , err := s .getSecurityGroupNameByID (ctx , projectId , id )
@@ -302,21 +298,6 @@ func generateUserData(publicKey string) (*[]byte, error) {
302298 return & byteArray , nil
303299}
304300
305- func (s * Stackit ) createVolume (ctx context.Context , projectId , volumeName , volumeAvailabilityZone string , volumeSize int64 ) (string , error ) {
306- createVolumePayload := iaas.CreateVolumePayload {
307- Name : & volumeName ,
308- AvailabilityZone : & volumeAvailabilityZone ,
309- Size : & volumeSize ,
310- }
311-
312- volume , err := s .client .CreateVolume (ctx , projectId ).CreateVolumePayload (createVolumePayload ).Execute ()
313- if err != nil {
314- return "" , err
315- }
316-
317- return * volume .Id , nil
318- }
319-
320301func (s * Stackit ) getServerByName (ctx context.Context , projectId , serverName string ) (* iaas.Server , error ) {
321302 servers , err := s .client .ListServers (ctx , projectId ).Details (true ).Execute ()
322303 if err != nil {
0 commit comments