Skip to content

Commit debcdbc

Browse files
Support for subordinate volume in TVP propagation and additional UTs
1 parent 663980b commit debcdbc

File tree

6 files changed

+1265
-20
lines changed

6 files changed

+1265
-20
lines changed

core/common.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,30 +160,29 @@ func getProtocol(
160160
//
161161
// A volume is ineligible if:
162162
// 1. Unmanaged Import - Trident doesn't manage it, can't resize
163-
// 2. Managed Import with Thick Provisioning (raw block SAN- NAS/file can autogrow)
163+
// 2. Thick Provisioning on SAN volumes - space-reserved volumes can't be autogrown (NAS/file can autogrow)
164164
// 3. Read-Only Clone - Immutable, can't be resized
165165
func isVolumeAutogrowIneligible(volConfig *storage.VolumeConfig) bool {
166166
// Unmanaged imports are ineligible
167167
if volConfig.ImportNotManaged {
168168
return true
169169
}
170170

171-
// Managed imports with thick provisioning (SpaceReserve == "volume") are ineligible
172-
// ONLY for SAN volumes - NAS volumes can be autogrown regardless of thick/thin provisioning
173-
if volConfig.ImportOriginalName != "" && volConfig.SpaceReserve == "volume" {
174-
// Use getProtocol to determine actual protocol based on volume configuration
171+
// Read-only clones are ineligible
172+
if volConfig.ReadOnlyClone {
173+
return true
174+
}
175+
176+
// Thick provisioning (SpaceReserve == "volume") is ineligible for SAN volumes
177+
// NAS volumes can be autogrown regardless of thick/thin provisioning
178+
if volConfig.SpaceReserve == "volume" {
175179
protocol, err := getProtocol(context.Background(), volConfig.VolumeMode, volConfig.AccessMode, volConfig.Protocol)
176180
// If protocol determination succeeds and it's NOT file (i.e., it's block/SAN), the volume is ineligible
177181
if err == nil && protocol != config.File {
178182
return true
179183
}
180184
}
181185

182-
// Read-only clones are ineligible
183-
if volConfig.ReadOnlyClone {
184-
return true
185-
}
186-
187186
return false
188187
}
189188

0 commit comments

Comments
 (0)