Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding name of resource that were not restored on applicationrestore.go #1389

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ bin/
help-cmdexecutor.1
help.1
coverage.txt
.idea

2 changes: 1 addition & 1 deletion pkg/applicationmanager/controllers/applicationrestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ func (a *ApplicationRestoreController) restoreResources(
for _, resource := range restore.Status.Resources {
if resource.Status != storkapi.ApplicationRestoreStatusSuccessful {
restore.Status.Status = storkapi.ApplicationRestoreStatusPartialSuccess
restore.Status.Reason = "Volumes were restored successfully. Some existing resources were not replaced"
restore.Status.Reason = fmt.Sprintf("Volumes were restored successfully. Some existing resources were not replaced, resource: %s", resource.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the overall status of the restore. So we are avoiding giving details of the specific resource. We do have resource level status, where the retained status is maintained. If we add the resource name here, it will confusing that only because of this resource alone, it is partial success.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siva-portworx I was thinking on that, it would require to change our Struct, changing the field restore.Status.reason to a slice of Strings, filling that list with the non-restored objects (with a previous check, if all of them failed, just inform that) and non stopping the for loop at the first occurrence as we currently do. All that sounds like lot of effort. I see, probably a message of where the user can find more details would be useful.

break
}
}
Expand Down