Skip to content

Commit 049413b

Browse files
authored
Merge pull request #395 from klueska/support-namespace-change-in-upgrade
Allow ComputeDomain resources to be removed from any namespace
2 parents f4af60e + 3a3a004 commit 049413b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cmd/compute-domain-controller/daemonset.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ func NewDaemonSetManager(config *ManagerConfig, getComputeDomain GetComputeDomai
7979
factory := informers.NewSharedInformerFactoryWithOptions(
8080
config.clientsets.Core,
8181
informerResyncPeriod,
82-
informers.WithNamespace(config.driverNamespace),
8382
informers.WithTweakListOptions(func(opts *metav1.ListOptions) {
8483
opts.LabelSelector = metav1.FormatLabelSelector(labelSelector)
8584
}),
@@ -317,6 +316,11 @@ func (m *DaemonSetManager) onAddOrUpdate(ctx context.Context, obj any) error {
317316
return fmt.Errorf("failed to cast to DaemonSet")
318317
}
319318

319+
// Only process events from the driver namespace
320+
if d.Namespace != m.config.driverNamespace {
321+
return nil
322+
}
323+
320324
klog.Infof("Processing added or updated DaemonSet: %s/%s", d.Namespace, d.Name)
321325

322326
cd, err := m.getComputeDomain(d.Labels[computeDomainLabelKey])

cmd/compute-domain-controller/resourceclaimtemplate.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func newBaseResourceClaimTemplateManager(config *ManagerConfig, getComputeDomain
8181
factory := informers.NewSharedInformerFactoryWithOptions(
8282
config.clientsets.Core,
8383
informerResyncPeriod,
84-
informers.WithNamespace(namespace),
8584
informers.WithTweakListOptions(func(opts *metav1.ListOptions) {
8685
opts.LabelSelector = metav1.FormatLabelSelector(labelSelector)
8786
}),

0 commit comments

Comments
 (0)