Skip to content

Commit

Permalink
fix: storage class sync error (#2402) (#2403)
Browse files Browse the repository at this point in the history
(cherry picked from commit 89f43eb)

Co-authored-by: Fabian Kramm <[email protected]>
  • Loading branch information
loft-bot and FabianKramm authored Jan 15, 2025
1 parent 7327b59 commit 99f4e93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/controllers/resources/persistentvolumeclaims/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ func New(ctx *synccontext.RegisterContext) (syncertypes.Object, error) {
return nil, err
}

storageClassesEnabled := ctx.Config.Sync.ToHost.StorageClasses.Enabled
return &persistentVolumeClaimSyncer{
GenericTranslator: translator.NewGenericTranslator(ctx, "persistent-volume-claim", &corev1.PersistentVolumeClaim{}, mapper),
Importer: pro.NewImporter(mapper),

excludedAnnotations: []string{bindCompletedAnnotation, boundByControllerAnnotation, storageProvisionerAnnotation},

storageClassesEnabled: storageClassesEnabled,
storageClassesEnabled: ctx.Config.Sync.ToHost.StorageClasses.Enabled,
schedulerEnabled: ctx.Config.ControlPlane.Advanced.VirtualScheduler.Enabled,
useFakePersistentVolumes: !ctx.Config.Sync.ToHost.PersistentVolumes.Enabled,
}, nil
Expand Down
4 changes: 3 additions & 1 deletion pkg/controllers/resources/persistentvolumes/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ func (s *persistentVolumeSyncer) translate(ctx *synccontext.SyncContext, vPv *co
pPV.Spec.ClaimRef = nil

// TODO: translate the storage secrets
pPV.Spec.StorageClassName = mappings.VirtualToHostName(ctx, vPv.Spec.StorageClassName, "", mappings.StorageClasses())
if pPV.Spec.StorageClassName != "" {
pPV.Spec.StorageClassName = translate.Default.HostNameCluster(vPv.Spec.StorageClassName)
}
return pPV, nil
}

Expand Down

0 comments on commit 99f4e93

Please sign in to comment.