Skip to content

[FEATURE] DataProcess does not support Cron and OnEvent policies unlike DataLoad and DataMigrate #5948

Description

@adityaupasani2

Background

DataLoad and DataMigrate both support three trigger policies via spec.policy:

  • Once — run the job once
  • Cron — run on a schedule
  • OnEvent — run when triggered by an event

Each has a corresponding StatusHandler implementation (OnceStatusHandler, CronStatusHandler, OnEventStatusHandler).

Problem

DataProcess currently has no Policy field in its spec and always uses OnceStatusHandler regardless:

// pkg/controllers/v1alpha1/dataprocess/implement.go
func (r *dataProcessOperation) GetStatusHandler() dataoperation.StatusHandler {
    // TODO: Support dataProcess.Spec.Policy
    return &OnceStatusHandler{Client: r.Client, dataProcess: r.dataProcess}
}

This means users cannot schedule recurring data processing jobs or trigger them on events functionality that is available for the other two data operations.

Proposed solution

  1. Add Policy and Schedule fields to DataProcessSpec in api/v1alpha1/dataprocess_types.go, matching the pattern from DataLoadSpec and DataMigrateSpec
  2. Implement CronStatusHandler and OnEventStatusHandler in pkg/controllers/v1alpha1/dataprocess/status_handler.go
  3. Update GetStatusHandler() to switch on policy
  4. Regenerate CRD manifests via make generate
  5. Add tests for all handlers

Notes

This follows the same pattern established in DataLoad and DataMigrate. Happy to work on this if the approach looks right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions