@@ -28,12 +28,13 @@ const (
2828 SvmStateCreated = "CREATED"
2929 AWSRegion = "AWS_REGION"
3030
31- TridentSecretPattern = "trident-%s"
32- SvmNamePattern = "trident-%s"
33- StorageClassNamePattern = "trident-%s-%s"
34- BackendNamePattern = "trident-%s-%s"
35- VsAdmin = "vsadmin"
36- Description = "Trident secret for FsxN for ONTAP"
31+ TridentSecretPattern = "trident-%s"
32+ SvmNamePattern = "trident-%s"
33+ StorageClassNamePattern = "trident-%s-%s"
34+ BackendNamePattern = "trident-%s-%s"
35+ SCManagedBackendNamePattern = "trident-%s-%s-%s"
36+ VsAdmin = "vsadmin"
37+ Description = "Trident secret for FsxN for ONTAP"
3738
3839 // Tags for the secret
3940 FileSystemId = "file-system-id"
@@ -288,7 +289,7 @@ func (aws *AWS) Create() ([]string, error) {
288289 )
289290 for _ , svm := range aws .SVMs {
290291 for _ , protocol := range svm .Protocols {
291- backendName = getFSxNBackendName (svm .FsxnID , protocol )
292+ backendName = getFSxNBackendName (aws , svm .FsxnID , protocol )
292293 backendYAML := getFsxnTBCYaml (svm , aws .TridentNamespace , backendName , protocol , aws .TBCNamePrefix , aws .SCManagedTConf , aws .TConfSpec )
293294 if err := aws .ConfClient .CreateOrPatchObject (confClients .OBackend , backendName ,
294295 aws .TridentNamespace , backendYAML ); err != nil {
@@ -342,7 +343,7 @@ func (aws *AWS) DeleteBackend(request map[string]interface{}) error {
342343 protocols := request ["protocols" ].([]string )
343344 fsxnId := request ["FSxNID" ].(string )
344345 for _ , protocol := range protocols {
345- backendName := getFSxNBackendName (fsxnId , protocol )
346+ backendName := getFSxNBackendName (aws , fsxnId , protocol )
346347 if err := aws .ConfClient .DeleteObject (confClients .OBackend , backendName , aws .TridentNamespace ); err != nil {
347348 return fmt .Errorf ("error occurred while deleting backend: %w" , err )
348349 }
@@ -447,7 +448,11 @@ func deleteSecret(ctx context.Context, aws *AWS, secretName string) error {
447448}
448449
449450// getFSxNBackendName returns the FsxN Trident backend config name
450- func getFSxNBackendName (fsxnId , protocolType string ) string {
451+ func getFSxNBackendName (aws * AWS , fsxnId , protocolType string ) string {
452+ if aws .SCManagedTConf {
453+ scName := strings .TrimPrefix (aws .TBCNamePrefix , "tconf-" )
454+ return fmt .Sprintf (SCManagedBackendNamePattern , scName , fsxnId , protocolType )
455+ }
451456 return fmt .Sprintf (BackendNamePattern , fsxnId , protocolType )
452457}
453458
0 commit comments