@@ -267,7 +267,7 @@ func (s *CallAteletRestoreStep) Execute(ctx context.Context, input *ResumeInput,
267267 return err
268268 }
269269
270- if state .Actor .GetLatestSnapshotInfo ().GetType () != ateapipb . SnapshotType_SNAPSHOT_TYPE_UNSPECIFIED {
270+ if data := state .Actor .GetLatestSnapshotInfo ().GetData (); data != nil {
271271 slog .InfoContext (ctx , "Actor has snapshot; Restoring from snapshot" )
272272
273273 req := & ateletpb.RestoreRequest {
@@ -278,25 +278,25 @@ func (s *CallAteletRestoreStep) Execute(ctx context.Context, input *ResumeInput,
278278 ActorTemplateName : state .Actor .GetActorTemplateName (),
279279 Spec : workloadSpec ,
280280 }
281- switch state . Actor . GetLatestSnapshotInfo (). GetType ( ) {
282- case ateapipb .SnapshotType_SNAPSHOT_TYPE_LOCAL :
281+ switch d := data .( type ) {
282+ case * ateapipb.SnapshotInfo_Local :
283283 req .Type = ateletpb .CheckpointType_CHECKPOINT_TYPE_LOCAL
284284 req .Config = & ateletpb.RestoreRequest_LocalConfig {
285285 LocalConfig : & ateletpb.LocalCheckpointConfiguration {
286- SnapshotPrefix : state . Actor . GetLatestSnapshotInfo (). GetLocal (). SnapshotPrefix ,
286+ SnapshotPrefix : d . Local . GetSnapshotPrefix () ,
287287 },
288288 }
289289 req .Scope = toAteletSnapshotScope (state .ActorTemplate .Spec .SnapshotsConfig .OnPause )
290- case ateapipb .SnapshotType_SNAPSHOT_TYPE_EXTERNAL :
290+ case * ateapipb.SnapshotInfo_External :
291291 req .Type = ateletpb .CheckpointType_CHECKPOINT_TYPE_EXTERNAL
292292 req .Config = & ateletpb.RestoreRequest_ExternalConfig {
293293 ExternalConfig : & ateletpb.ExternalCheckpointConfiguration {
294- SnapshotUriPrefix : state . Actor . GetLatestSnapshotInfo (). GetExternal (). SnapshotUriPrefix ,
294+ SnapshotUriPrefix : d . External . GetSnapshotUriPrefix () ,
295295 },
296296 }
297297 req .Scope = toAteletSnapshotScope (state .ActorTemplate .Spec .SnapshotsConfig .OnCommit )
298298 default :
299- return fmt .Errorf ("unsupported snapshot type: %v " , state . Actor . GetLatestSnapshotInfo (). GetType () )
299+ return fmt .Errorf ("unsupported snapshot type: %T " , data )
300300 }
301301
302302 _ , err = client .Restore (ctx , req )
0 commit comments