@@ -1006,6 +1006,14 @@ func (h *helper) processStorageClass(ctx context.Context, sc *k8sstoragev1.Stora
10061006 scConfig .Name = sc .Name
10071007 scConfig .Attributes = make (map [string ]storageattribute.Request )
10081008
1009+ // Check if configuratorStatus annotation is present. It suggests the SC is managed by a TridentConfigurator.
1010+ // We might encounter initial unknown parameters errors but once we see the configuratorStatus annotation,
1011+ // we know the SC is managed by a TridentConfigurator and we can ignore the unknown parameters.
1012+ ignoreUnknownParamErrors := false
1013+ if _ , exists := sc .ObjectMeta .Annotations [AnnConfiguratorStatus ]; exists {
1014+ ignoreUnknownParamErrors = true
1015+ }
1016+
10091017 // Populate storage class config attributes and backend storage pools
10101018 for k , v := range sc .Parameters {
10111019
@@ -1048,6 +1056,9 @@ func (h *helper) processStorageClass(ctx context.Context, sc *k8sstoragev1.Stora
10481056 // format: attribute: "value"
10491057 req , err := storageattribute .CreateAttributeRequestFromAttributeValue (newKey , v )
10501058 if err != nil {
1059+ if ignoreUnknownParamErrors {
1060+ continue
1061+ }
10511062 Logc (ctx ).WithFields (logFields ).WithError (err ).Errorf (
10521063 "K8S helper could not process the storage class attribute %s" , newKey )
10531064 return
@@ -1057,6 +1068,7 @@ func (h *helper) processStorageClass(ctx context.Context, sc *k8sstoragev1.Stora
10571068 }
10581069
10591070 // To allow for atomic selector updates, replace selector with an annotation if it exists
1071+ // Also allow additionalStoragePools to be overridden via annotation
10601072 for k , v := range sc .ObjectMeta .Annotations {
10611073 if k == AnnSelector {
10621074 req , err := storageattribute .CreateAttributeRequestFromAttributeValue ("selector" , v )
@@ -1067,6 +1079,18 @@ func (h *helper) processStorageClass(ctx context.Context, sc *k8sstoragev1.Stora
10671079 }
10681080 scConfig .Attributes ["selector" ] = req
10691081 }
1082+ if k == AnnAdditionalStoragePools {
1083+ // Override additionalStoragePools parameter with annotation value
1084+ additionalPools , err := storageattribute .CreateBackendStoragePoolsMapFromEncodedString (v )
1085+ if err != nil {
1086+ Logc (ctx ).WithFields (logFields ).WithField (k , v ).WithError (err ).Errorf (
1087+ "K8S helper could not process the storage class annotation %s." , k )
1088+ continue
1089+ }
1090+ scConfig .AdditionalPools = additionalPools
1091+ Logc (ctx ).WithFields (logFields ).WithField ("additionalStoragePools" , v ).
1092+ Debug ("Using additionalStoragePools from annotation to override parameter" )
1093+ }
10701094 }
10711095
10721096 if update {
0 commit comments