make eden doctor detect nested checkouts

Summary:
eden doctor should detect when a user has nested checkouts and warn them that it could cause issues. No action should be taken at this time because the nested checkouts could be intentional.

In the future, we may attempt to fix the issue for the user.

Reviewed By: chadaustin

Differential Revision: D32517950

fbshipit-source-id: 15c0e60149d0513a8bee72adc254b0fae369edfe
This commit is contained in:
Michael Cuevas 2021-12-10 11:06:00 -08:00 committed by Facebook GitHub Bot
parent f84ca470b0
commit 9b17531f63

View File

@ -457,6 +457,19 @@ def check_mount(
"unknown state {checkout.state}"
)
)
# Check if this checkout is nested inside another one
existing_checkout, rel_path = config_mod.detect_nested_checkout(
checkout.path,
instance,
)
if existing_checkout is not None and rel_path is not None:
tracker.add_problem(
Problem(
f"""\
edenfs reports that checkout {checkout.path} is nested within an existing checkout {existing_checkout.path}
Nested checkouts are usually not intended and can cause spurious behavior.\n"""
)
)
def check_mount_overlay_type(