feat: add manager

This commit is contained in:
2024-11-30 23:36:44 +03:30
parent d8b87ac6ee
commit 6bd197b812
14 changed files with 109 additions and 67 deletions

View File

@@ -40,25 +40,13 @@ func (crd Crd) watchFlinkJobs() {
case watch.Modified:
fmt.Printf("FlinkJob updated: %s\n", job.GetName())
// Handle the new FlinkJob
handleNewFlinkJob(job)
crd.repsert(job)
case watch.Added:
fmt.Printf("New FlinkJob created: %s\n", job.GetName())
// Handle the new FlinkJob
handleNewFlinkJob(job)
crd.repsert(job)
case watch.Deleted:
}
}
}
func handleNewFlinkJob(job *v1alpha1.FlinkJob) {
// Extract job details
name := job.GetName()
namespace := job.GetNamespace()
// Process job specification
fmt.Printf("Processing FlinkJob %s in namespace %s kind: %s \n", name, namespace, job.Kind)
lc.Logger.Debug("[crd] [watch]", zap.Any("spec", job), zap.Any("name", job.Spec.Name))
// Add your custom logic here
}