@@ -90,7 +90,7 @@ func instanceImageTransfer(s *state.State, r *http.Request, projectName string,
90
90
return nil
91
91
}
92
92
93
- func ensureImageIsLocallyAvailable (ctx context.Context , s * state.State , r * http.Request , img * api.Image , projectName string , instanceType instancetype. Type ) error {
93
+ func ensureImageIsLocallyAvailable (ctx context.Context , s * state.State , r * http.Request , img * api.Image , projectName string ) error {
94
94
// Check if the image is available locally or it's on another member.
95
95
// Ensure we are the only ones operating on this image. Otherwise another instance created at the same
96
96
// time may also arrive at the conclusion that the image doesn't exist on this cluster member and then
@@ -134,7 +134,7 @@ func ensureImageIsLocallyAvailable(ctx context.Context, s *state.State, r *http.
134
134
}
135
135
136
136
// instanceCreateFromImage creates an instance from a rootfs image.
137
- func instanceCreateFromImage (ctx context.Context , s * state.State , r * http. Request , img * api.Image , args db.InstanceArgs , op * operations.Operation ) error {
137
+ func instanceCreateFromImage (ctx context.Context , s * state.State , img * api.Image , args db.InstanceArgs , op * operations.Operation ) error {
138
138
reverter := revert .New ()
139
139
defer reverter .Fail ()
140
140
@@ -289,7 +289,7 @@ func instanceRebuildFromImage(ctx context.Context, s *state.State, r *http.Reque
289
289
return fmt .Errorf ("Requested image's type %q doesn't match instance type %q" , imgType , inst .Type ())
290
290
}
291
291
292
- err = ensureImageIsLocallyAvailable (ctx , s , r , img , inst .Project ().Name , inst . Type () )
292
+ err = ensureImageIsLocallyAvailable (ctx , s , r , img , inst .Project ().Name )
293
293
if err != nil {
294
294
return err
295
295
}
@@ -302,7 +302,7 @@ func instanceRebuildFromImage(ctx context.Context, s *state.State, r *http.Reque
302
302
return nil
303
303
}
304
304
305
- func instanceRebuildFromEmpty (s * state. State , inst instance.Instance , op * operations.Operation ) error {
305
+ func instanceRebuildFromEmpty (inst instance.Instance , op * operations.Operation ) error {
306
306
err := inst .Rebuild (nil , op ) // Rebuild as empty.
307
307
if err != nil {
308
308
return fmt .Errorf ("Failed rebuilding as an empty instance: %w" , err )
@@ -588,7 +588,7 @@ func autoCreateInstanceSnapshots(ctx context.Context, s *state.State, instances
588
588
589
589
var instSnapshotsPruneRunning = sync.Map {}
590
590
591
- func pruneExpiredInstanceSnapshots (ctx context.Context , s * state. State , snapshots []instance.Instance ) error {
591
+ func pruneExpiredInstanceSnapshots (ctx context.Context , snapshots []instance.Instance ) error {
592
592
// Find snapshots to delete
593
593
for _ , snapshot := range snapshots {
594
594
err := ctx .Err ()
@@ -736,7 +736,7 @@ func pruneExpiredAndAutoCreateInstanceSnapshotsTask(d *Daemon) (task.Func, task.
736
736
// disk space.
737
737
if len (expiredSnapshotInstances ) > 0 {
738
738
opRun := func (op * operations.Operation ) error {
739
- return pruneExpiredInstanceSnapshots (ctx , s , expiredSnapshotInstances )
739
+ return pruneExpiredInstanceSnapshots (ctx , expiredSnapshotInstances )
740
740
}
741
741
742
742
op , err := operations .OperationCreate (s , "" , operations .OperationClassTask , operationtype .SnapshotsExpire , nil , nil , opRun , nil , nil , nil )
0 commit comments