@@ -146,15 +146,11 @@ func (s *Stackit) Delete(ctx context.Context, projectId, machineName string) err
146
146
}
147
147
148
148
networkId := nics [0 ].NetworkId
149
- err = s .client . DeleteNetwork (ctx , projectId , * networkId ). Execute ( )
149
+ err = s .deleteNetwork (ctx , projectId , * networkId )
150
150
if err != nil {
151
151
log .Default .Errorf ("failed to delete network" )
152
152
gotError = true
153
153
}
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
- }
158
154
159
155
for _ , id := range * nics [0 ].SecurityGroups {
160
156
name , err := s .getSecurityGroupNameByID (ctx , projectId , id )
@@ -302,21 +298,6 @@ func generateUserData(publicKey string) (*[]byte, error) {
302
298
return & byteArray , nil
303
299
}
304
300
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
-
320
301
func (s * Stackit ) getServerByName (ctx context.Context , projectId , serverName string ) (* iaas.Server , error ) {
321
302
servers , err := s .client .ListServers (ctx , projectId ).Details (true ).Execute ()
322
303
if err != nil {
0 commit comments