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

Reorder isMounted for readability #1087

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

wongma7
Copy link
Contributor

@wongma7 wongma7 commented Oct 11, 2021

Is this a bug fix or adding new feature?

What is this PR about? / Why do we need it? my addition #1081 made this function a bit confusing #1083 (comment) so want to do some quick refactoring before I forget what intention of my change was.

  • make return value explicit for each case
    • if returning error, just return false. The caller should check the error and ignore the boolean.
    • if target DNE, just return false. IsLikelyNotMountPoint must have returned "true, ErrNotExists", so returning "false, nil" is the same as returning "!notMnt, nil" like this function was doing before
  • add debug log message for case when target path doesn't exist (on Windows it would be annoying at lower verbosity cuz it would get printed all the time
  • make isMounted come right after preparePublishPath in both the block and non-block case.

What testing is done?

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 11, 2021
@wongma7
Copy link
Contributor Author

wongma7 commented Oct 11, 2021

/cc @nckturner

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 11, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wongma7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 11, 2021
@wongma7 wongma7 changed the title Reorder isMounted for readability WIP: Reorder isMounted for readability Oct 11, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2021
@wongma7
Copy link
Contributor Author

wongma7 commented Oct 11, 2021

it might be clearer to just make isMounted platform specific.

@wongma7 wongma7 changed the title WIP: Reorder isMounted for readability Reorder isMounted for readability Oct 11, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2021
Copy link
Contributor

@nirmalaagash nirmalaagash left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 002b3aa into kubernetes-sigs:master Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants