Skip to content

Commit d2c95bf

Browse files
authored
Disable ASA R2 backends with concurrent core
1 parent e13eb19 commit d2c95bf

4 files changed

Lines changed: 73 additions & 10 deletions

File tree

config/config.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,17 @@ var (
444444
K8sAPIQPS float32
445445
K8sAPIBurst int
446446

447+
// Concurrency context
448+
IsConcurrent bool
449+
ConcurrentBackends = []string{
450+
"ontap-san",
451+
"fake",
452+
"ontap-nas",
453+
"google-cloud-netapp-volumes",
454+
"ontap-nas-economy",
455+
"ontap-san-economy",
456+
}
457+
447458
// Absolute max age for ANY TAGRI (safety net to prevent stuck states) before forced deletion
448459
TagriTimeout time.Duration
449460

core/concurrent_core.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,7 @@ type ConcurrentTridentOrchestrator struct {
6464
}
6565

6666
var (
67-
_ Orchestrator = &ConcurrentTridentOrchestrator{}
68-
supportedBackends = []string{
69-
"ontap-san",
70-
"fake",
71-
"ontap-nas",
72-
"google-cloud-netapp-volumes",
73-
"ontap-nas-economy",
74-
"ontap-san-economy",
75-
}
67+
_ Orchestrator = &ConcurrentTridentOrchestrator{}
7668
)
7769

7870
func NewConcurrentTridentOrchestrator(client persistentstore.Client) (Orchestrator, error) {
@@ -177,6 +169,7 @@ func (o *ConcurrentTridentOrchestrator) transformPersistentState(ctx context.Con
177169
}
178170

179171
func (o *ConcurrentTridentOrchestrator) Bootstrap(_ bool) error {
172+
config.IsConcurrent = true
180173
ctx := GenerateRequestContext(nil, "", ContextSourceInternal, WorkflowCoreBootstrap, LogLayerCore)
181174
var err error
182175

@@ -851,7 +844,7 @@ func (o *ConcurrentTridentOrchestrator) validateAndCreateBackendFromConfig(
851844

852845
commonConfig.Flags[FlagConcurrent] = "true"
853846

854-
if !collection.StringInSlice(commonConfig.StorageDriverName, supportedBackends) {
847+
if !collection.StringInSlice(commonConfig.StorageDriverName, config.ConcurrentBackends) {
855848
return nil, fmt.Errorf("backend type %s is not yet supported by concurrent Trident",
856849
commonConfig.StorageDriverName)
857850
}

storage_drivers/ontap/ontap_factory.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package ontap
55
import (
66
"context"
77
"encoding/json"
8+
"errors"
89
"fmt"
910
"strconv"
1011
"strings"
@@ -121,6 +122,10 @@ func getSANStorageDriverBasedOnPersonality(
121122
isASAr2 = true
122123
}
123124

125+
if isASAr2 && config.IsConcurrent {
126+
return nil, errors.New("ASA r2 backend type is not yet supported by concurrent Trident")
127+
}
128+
124129
switch driverProtocol {
125130
case sa.ISCSI:
126131
if isASAr2 {

storage_drivers/ontap/ontap_factory_test.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
6666

6767
tests := []struct {
6868
name string
69+
concurrent bool
6970
sanOptimized bool
7071
disaggregated bool
7172
driverProtocol string
@@ -74,14 +75,34 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
7475
}{
7576
{
7677
name: "ASA optimized and disaggregated with iSCSI",
78+
concurrent: false,
7779
sanOptimized: true,
7880
disaggregated: true,
7981
driverProtocol: sa.ISCSI,
8082
expectedDriverType: &ASAStorageDriver{},
8183
expectError: false,
8284
},
85+
{
86+
name: "ASA optimized and disaggregated with iSCSI, concurrent",
87+
concurrent: true,
88+
sanOptimized: true,
89+
disaggregated: true,
90+
driverProtocol: sa.ISCSI,
91+
expectedDriverType: nil,
92+
expectError: true,
93+
},
8394
{
8495
name: "SAN optimized but not disaggregated with iSCSI",
96+
concurrent: false,
97+
sanOptimized: true,
98+
disaggregated: false,
99+
driverProtocol: sa.ISCSI,
100+
expectedDriverType: &SANStorageDriver{},
101+
expectError: false,
102+
},
103+
{
104+
name: "SAN optimized but not disaggregated with iSCSI, concurrent",
105+
concurrent: true,
85106
sanOptimized: true,
86107
disaggregated: false,
87108
driverProtocol: sa.ISCSI,
@@ -90,6 +111,16 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
90111
},
91112
{
92113
name: "Standard SAN with iSCSI",
114+
concurrent: false,
115+
sanOptimized: false,
116+
disaggregated: false,
117+
driverProtocol: sa.ISCSI,
118+
expectedDriverType: &SANStorageDriver{},
119+
expectError: false,
120+
},
121+
{
122+
name: "Standard SAN with iSCSI, concurrent",
123+
concurrent: true,
93124
sanOptimized: false,
94125
disaggregated: false,
95126
driverProtocol: sa.ISCSI,
@@ -98,6 +129,16 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
98129
},
99130
{
100131
name: "Standard SAN with NVMe",
132+
concurrent: false,
133+
sanOptimized: false,
134+
disaggregated: false,
135+
driverProtocol: sa.NVMe,
136+
expectedDriverType: &NVMeStorageDriver{},
137+
expectError: false,
138+
},
139+
{
140+
name: "Standard SAN with NVMe, concurrent",
141+
concurrent: true,
101142
sanOptimized: false,
102143
disaggregated: false,
103144
driverProtocol: sa.NVMe,
@@ -106,6 +147,16 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
106147
},
107148
{
108149
name: "Standard SAN with FCP",
150+
concurrent: false,
151+
sanOptimized: false,
152+
disaggregated: false,
153+
driverProtocol: sa.FCP,
154+
expectedDriverType: &SANStorageDriver{},
155+
expectError: false,
156+
},
157+
{
158+
name: "Standard SAN with FCP, concurrent",
159+
concurrent: true,
109160
sanOptimized: false,
110161
disaggregated: false,
111162
driverProtocol: sa.FCP,
@@ -114,6 +165,7 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
114165
},
115166
{
116167
name: "Unsupported protocol",
168+
concurrent: false,
117169
sanOptimized: false,
118170
disaggregated: false,
119171
driverProtocol: "unsupported",
@@ -124,6 +176,8 @@ func TestGetSANStorageDriverBasedOnPersonality(t *testing.T) {
124176

125177
for _, test := range tests {
126178
t.Run(test.name, func(t *testing.T) {
179+
config.IsConcurrent = test.concurrent
180+
127181
driver, err := getSANStorageDriverBasedOnPersonality(
128182
test.sanOptimized, test.disaggregated, test.driverProtocol, &ontapConfig, mockAPI, mockAWSAPI,
129183
)

0 commit comments

Comments
 (0)