Skip to content

Commit

Permalink
data mover ms node agent resume
Browse files Browse the repository at this point in the history
Signed-off-by: Lyndon-Li <[email protected]>
  • Loading branch information
Lyndon-Li committed Aug 12, 2024
1 parent 2c7047a commit 04db3ba
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/builder/data_download_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (d *DataDownloadBuilder) CompletionTimestamp(completionTimestamp *metav1.Ti
return d
}

// Labels sets the DataDownload's Progress.
// Progress sets the DataDownload's Progress.
func (d *DataDownloadBuilder) Progress(progress shared.DataMoveOperationProgress) *DataDownloadBuilder {
d.object.Status.Progress = progress
return d
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/data_upload_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (d *DataUploadBuilder) Labels(labels map[string]string) *DataUploadBuilder
return d
}

// Labels sets the DataUpload's Progress.
// Progress sets the DataUpload's Progress.
func (d *DataUploadBuilder) Progress(progress shared.DataMoveOperationProgress) *DataUploadBuilder {
d.object.Status.Progress = progress
return d
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/cli/nodeagent/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ func (s *nodeAgentServer) run() {
if err := dataDownloadReconciler.AttemptDataDownloadResume(s.ctx, s.mgr.GetClient(), s.logger.WithField("node", s.nodeName), s.namespace); err != nil {
s.logger.WithError(errors.WithStack(err)).Error("failed to attempt data download resume")

Check warning on line 313 in pkg/cmd/cli/nodeagent/server.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/cli/nodeagent/server.go#L312-L313

Added lines #L312 - L313 were not covered by tests
}

s.logger.Info("Attempt complete to resume dataUploads and dataDownloads")

Check warning on line 316 in pkg/cmd/cli/nodeagent/server.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/cli/nodeagent/server.go#L316

Added line #L316 was not covered by tests
}()

s.logger.Info("Controllers starting...")
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_download_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ func (r *DataDownloadReconciler) resumeCancellableDataPath(ctx context.Context,
if err := asyncBR.StartRestore(dd.Spec.SnapshotID, datapath.AccessPoint{
ByPath: res.ByPod.VolumeName,
}, nil); err != nil {
return errors.Wrapf(err, "error to resume asyncBR watche for dd %s", dd.Name)
return errors.Wrapf(err, "error to resume asyncBR watcher for dd %s", dd.Name)
}

resumeComplete = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_download_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ func TestResumeCancellableRestore(t *testing.T) {
mockStart: true,
mockClose: true,
startWatcherErr: errors.New("fake-start-watcher-error"),
expectedError: fmt.Sprintf("error to resume asyncBR watche for dd %s: fake-start-watcher-error", dataDownloadName),
expectedError: fmt.Sprintf("error to resume asyncBR watcher for dd %s: fake-start-watcher-error", dataDownloadName),
},
{
name: "succeed",
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_upload_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ func (r *DataUploadReconciler) resumeCancellableDataPath(ctx context.Context, du
if err := asyncBR.StartBackup(datapath.AccessPoint{
ByPath: res.ByPod.VolumeName,
}, du.Spec.DataMoverConfig, nil); err != nil {
return errors.Wrapf(err, "error to resume asyncBR watche for du %s", du.Name)
return errors.Wrapf(err, "error to resume asyncBR watcher for du %s", du.Name)
}

resumeComplete = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_upload_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ func TestResumeCancellableBackup(t *testing.T) {
mockStart: true,
mockClose: true,
startWatcherErr: errors.New("fake-start-watcher-error"),
expectedError: fmt.Sprintf("error to resume asyncBR watche for du %s: fake-start-watcher-error", dataUploadName),
expectedError: fmt.Sprintf("error to resume asyncBR watcher for du %s: fake-start-watcher-error", dataUploadName),
},
{
name: "succeed",
Expand Down

0 comments on commit 04db3ba

Please sign in to comment.