@@ -211,7 +211,7 @@ func (m *ResourceManager) applyItem(ctx context.Context, groupRes string, itm co
211211
212212 if gvr .Resource == apis .PersistentVolumeClaims .Resource &&
213213 m .StorageClassMappingsStr != "" {
214- if spec , ok := sObj ["spec" ].(map [string ]interface {} ); ok && spec != nil {
214+ if spec , ok := sObj ["spec" ].(map [string ]any ); ok && spec != nil {
215215 sObj ["spec" ] = m .mapStorageClass (spec )
216216 }
217217 }
@@ -257,7 +257,7 @@ func (m *ResourceManager) downloadTheItem(groupRes string, obj *unstructured.Uns
257257 return nil
258258}
259259
260- func (m * ResourceManager ) mapStorageClass (spec map [string ]interface {} ) map [string ]interface {} {
260+ func (m * ResourceManager ) mapStorageClass (spec map [string ]any ) map [string ]any {
261261 if oldStorageClassName , ok := spec ["storageClassName" ].(string ); ok {
262262 if _ , exist := m .StorageClassMappings [oldStorageClassName ]; exist {
263263 spec ["storageClassName" ] = m .StorageClassMappings [oldStorageClassName ]
@@ -273,7 +273,7 @@ func (m *ResourceManager) ensureNamespace(ctx context.Context, ns string) error
273273 klog .V (2 ).Infof ("Iteration %d: namespace %s exists" , m .currentIteration , ns )
274274 return nil
275275 }
276- obj := & unstructured.Unstructured {Object : map [string ]interface {}{ "apiVersion" : "v1" , "kind" : "Namespace" , "metadata" : map [string ]interface {} {"name" : ns }}}
276+ obj := & unstructured.Unstructured {Object : map [string ]any { "apiVersion" : "v1" , "kind" : "Namespace" , "metadata" : map [string ]any {"name" : ns }}}
277277 key := getItemKey (obj )
278278 if _ , done := m .restoredItems [key ]; done {
279279 klog .V (3 ).Infof ("Iteration %d: already restored %s" , m .currentIteration , key )
@@ -334,8 +334,8 @@ func (m *ResourceManager) setOwnerReferences(ctx context.Context) error {
334334 continue
335335 }
336336
337- patchPayload := map [string ]interface {} {
338- "metadata" : map [string ]interface {} {
337+ patchPayload := map [string ]any {
338+ "metadata" : map [string ]any {
339339 "ownerReferences" : validRelinkedOwners ,
340340 },
341341 }
@@ -401,7 +401,7 @@ func (m *ResourceManager) shouldRestore(obj *unstructured.Unstructured) bool {
401401 return false
402402 }
403403 labels := LabelsToStrings (obj .GetLabels ())
404- return matchesAny (labels , m .Options . ORedLabelSelectors ) && matchesAll (labels , m . Options .ANDedLabelSelectors )
404+ return matchesAny (labels , m .ORedLabelSelectors ) && matchesAll (labels , m .ANDedLabelSelectors )
405405}
406406
407407func (m * ResourceManager ) isNamespaced (groupRes string ) (bool , error ) {
@@ -430,7 +430,7 @@ func (m *ResourceManager) parseItems() (map[string]*common.ResourceItems, error)
430430 klog .Errorf ("Failed to get restic stats: %v" , err )
431431 } else {
432432 for _ , resticStat := range manifestResticStats {
433- baseDir := filepath .Join (m .Options . DataDir , m .SnapshotName , apis .ComponentManifest , resticStat .HostPath )
433+ baseDir := filepath .Join (m .DataDir , m .SnapshotName , apis .ComponentManifest , resticStat .HostPath )
434434 entries , err := m .reader .ReadDir (baseDir )
435435 if err != nil {
436436 return nil , fmt .Errorf ("failed to read backup directory: %w" , err )
@@ -498,7 +498,7 @@ func (m *ResourceManager) getRestoreableItems(r *common.ResourceItems) map[strin
498498 klog .Errorf ("Failed to get restic stats: %v" , err )
499499 } else {
500500 for _ , resticStat := range manifestResticStats {
501- baseDir := filepath .Join (m .Options . DataDir , m .SnapshotName , apis .ComponentManifest , resticStat .HostPath )
501+ baseDir := filepath .Join (m .DataDir , m .SnapshotName , apis .ComponentManifest , resticStat .HostPath )
502502 resourceForPath := filepath .Join (baseDir , r .GroupResource )
503503 for namespace , items := range r .ItemsByNamespace {
504504 identifier := apis .NamespaceScopedDir
0 commit comments