fix: resolve finalize is not working in some cases
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"flink-kube-operator/internal/crd/v1alpha1"
|
||||
"os"
|
||||
|
||||
"github.com/reactivex/rxgo/v2"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/rest"
|
||||
@@ -48,11 +49,13 @@ func New() *Crd {
|
||||
runtimeClient: runtimeClient,
|
||||
}
|
||||
|
||||
// Watch for FlinkJob creation
|
||||
jobEventObservable := crd.watchFlinkJobs()
|
||||
jobEventCh := make(chan rxgo.Item)
|
||||
|
||||
// add finalizer to new resources
|
||||
go crd.manageFinalizer(jobEventObservable)
|
||||
go crd.manageFinalizer(rxgo.FromChannel(jobEventCh))
|
||||
|
||||
// Watch for FlinkJob creation
|
||||
crd.watchFlinkJobs(jobEventCh)
|
||||
|
||||
return &crd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user