Honor fqdn StorageClass param when Anvil returns no data-portals - #66
Open
dfsweden wants to merge 1 commit into
Open
Honor fqdn StorageClass param when Anvil returns no data-portals#66dfsweden wants to merge 1 commit into
dfsweden wants to merge 1 commit into
Conversation
In a no-DSX deployment (Anvil-only, storage nodes registered as NODE/OTHER), GET /mgmt/v1.2/rest/data-portals/ returns []. In MountShareAtBestDataportal the resolved fipaddr (from the StorageClass `fqdn` parameter, or the floating IP) was only ever consumed inside the per-portal mount loops. With an empty portals list those loops had zero iterations, so the FQDN/IP the function resolved was discarded and the driver failed with "could not mount to any data-portals" — breaking file-backed PVC provisioning in any DSX-less environment, even when the user supplied `fqdn:` as the intended escape hatch. Synthesize a single DataPortal from the resolved fipaddr when the portal list is empty, so the existing mount logic (showmount export discovery, NFS 4.2 -> 3 fallback) runs against it. Mirrors the FQDN-first handling already present in EnsureRootExportMounted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ravi100k
self-requested a review
July 1, 2026 07:02
ravi100k
approved these changes
Jul 1, 2026
ravi100k
reviewed
Jul 1, 2026
| // resolved fipaddr (from the FQDN or floating IP) would be silently thrown | ||
| // away. Synthesize a single portal from fipaddr so the existing mount logic | ||
| // (export discovery via showmount, NFS 4.2 -> 3 fallback) still runs. | ||
| if len(portals) == 0 && fipaddr != "" { |
Collaborator
There was a problem hiding this comment.
@dfsweden
If no data-portals exist and no fqdn is provided, fipaddr remains empty, this synthetic portal block is skipped, and MountShareAtBestDataportal still returns "could not mount to any data-portals".
Should this fallback use GetAnvilPortal() when portals is empty and fipaddr is empty?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In a no-DSX deployment (Anvil-only; storage nodes registered as NODE/OTHER),
GET /mgmt/v1.2/rest/data-portals/returns[]. InMountShareAtBestDataportalthe address resolved from the StorageClassfqdnparameter (or the floating IP) was only ever consumed inside the per-data-portal mount loops. With an empty portals list those loops have zero iterations, so the resolved address is silently discarded and the driver fails withcould not mount to any data-portals.This broke file-backed PVC provisioning in any DSX-less environment — even when the user supplied
fqdn:, which is the exact escape hatch that parameter is meant to be.Fix
When
GetDataPortalsreturns an empty list but an address was resolved, synthesize a singleDataPortalfrom that address so the existing mount logic (showmount export discovery, NFS 4.2 → 3 fallback) runs against it. This mirrors the FQDN-first handling already present inEnsureRootExportMounted.Scope
pkg/driver/utils.go—MountShareAtBestDataportal(+20 lines)CHANGELOG.md— one entry under[1.2.9] > FixedNo behavior change when data-portals are present (the synthesis only triggers on an empty list). Also covers the floating-IP-but-no-portals case.
Testing
make compilesucceeds (static binary, v1.2.9).TestAcquireVolumeLockTimeoutfailure aside).