Skip to content

Commit 7d82df5

Browse files
Update namespace syncer to import namespaces (#2800)
1 parent 04a412c commit 7d82df5

File tree

1 file changed

+1
-2
lines changed
  • pkg/controllers/resources/namespaces

1 file changed

+1
-2
lines changed

pkg/controllers/resources/namespaces/syncer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/loft-sh/vcluster/pkg/syncer/synccontext"
1111
"github.com/loft-sh/vcluster/pkg/syncer/translator"
1212
syncertypes "github.com/loft-sh/vcluster/pkg/syncer/types"
13-
"github.com/loft-sh/vcluster/pkg/util/translate"
1413
corev1 "k8s.io/api/core/v1"
1514
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1615
utilerrors "k8s.io/apimachinery/pkg/util/errors"
@@ -110,7 +109,7 @@ func (s *namespaceSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.
110109

111110
func (s *namespaceSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *synccontext.SyncToVirtualEvent[*corev1.Namespace]) (_ ctrl.Result, retErr error) {
112111
// virtual object is not here anymore, so we delete
113-
if event.VirtualOld != nil || translate.ShouldDeleteHostObject(event.Host) {
112+
if event.VirtualOld != nil || event.Host.DeletionTimestamp != nil {
114113
return patcher.DeleteHostObject(ctx, event.Host, event.VirtualOld, "virtual object was deleted")
115114
}
116115

0 commit comments

Comments
 (0)