Skip to content

Commit a050137

Browse files
committed
fix(csi): ignores AccessibilityRequirements when dataLocality is strict-local
Longhorn 12343 Signed-off-by: Derek Su <derek.su@suse.com>
1 parent e86a378 commit a050137

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

csi/controller_server.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,16 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
133133

134134
// Extract AccessibleTopology from AccessibilityRequirements
135135
// This will be used to set PV nodeAffinity via external-provisioner
136-
accessibleTopology := cs.getAccessibleTopologyFromRequirements(req.GetAccessibilityRequirements())
137136

138-
// Warn when strict-local dataLocality is combined with accessibleTopology (PV nodeAffinity becomes immutable).
139-
// Ref: https://github.com/longhorn/longhorn/issues/12261
140-
if accessibleTopology != nil && volumeParameters["dataLocality"] == string(longhorn.DataLocalityStrictLocal) {
141-
log.Warnf("CreateVolume for %s uses strict-local dataLocality with accessibleTopology; PV nodeAffinity will be immutable and may conflict with Longhorn strict-local behavior", volumeID)
137+
var accessibleTopology []*csi.Topology
138+
139+
if volumeParameters["dataLocality"] == string(longhorn.DataLocalityStrictLocal) {
140+
log.Infof(
141+
"CreateVolume for %s ignores AccessibilityRequirements because dataLocality is strict-local; the volume will be created only on the requested node",
142+
volumeID,
143+
)
144+
} else {
145+
accessibleTopology = cs.getAccessibleTopologyFromRequirements(req.GetAccessibilityRequirements())
142146
}
143147

144148
volumeSource := req.GetVolumeContentSource()

0 commit comments

Comments
 (0)