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

Split device sync into readable functions #879

Conversation

balamurugana
Copy link
Member

No description provided.

Signed-off-by: Bala.FA <bala@minio.io>
@balamurugana balamurugana force-pushed the Split-device-sync-into-readable-functions branch from c8f0f2c to 93783b6 Compare November 1, 2023 01:30
drive.Spec.Relabel = false
}

return true
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we return the updated var instead? and we can set this var to true whenever the drive fields are updated. There are cases where we don't need the drive update.

Copy link
Member Author

Choose a reason for hiding this comment

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

In error case and success case, we should set updated = true. This means we are returning true in any case. That's why return true is correct.

}

if err == nil {
drive.Spec.Relabel = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we set updated = true here and return at the end?

default:
if latestErrorConditionType != directpvtypes.DriveConditionTypeIOError {
drive.Status.Status = directpvtypes.DriveStatusError
drive.SetRelabelErrorCondition(fmt.Sprintf("unable to relabel; %v", err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we set updated = true here and return at the end?

@Praveenrajmani Praveenrajmani merged commit bc00b70 into minio:master Nov 3, 2023
24 checks passed
@balamurugana balamurugana deleted the Split-device-sync-into-readable-functions branch November 5, 2023 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants