diff --git a/.mockery.yaml b/.mockery.yaml index 7e3b97a136..e7de5e50b1 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -15,6 +15,11 @@ packages: include-auto-generated: true all: true dir: 'gen/go/flyteidl2/workflow/mocks' + github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow/workflowconnect: + config: + include-auto-generated: true + all: true + dir: 'gen/go/flyteidl2/workflow/workflowconnect/mocks' github.com/flyteorg/flyte/v2/gen/go/flyteidl2/secret: config: include-auto-generated: true diff --git a/executor/DEVELOPMENT.md b/executor/DEVELOPMENT.md new file mode 100644 index 0000000000..fdd84ea4cd --- /dev/null +++ b/executor/DEVELOPMENT.md @@ -0,0 +1,154 @@ +# Executor Development Guide + +This guide provides steps on how to develop and iterates changes. + +## Prerequisites +- go version v1.24.0+ +- docker version 17.03+. +- kubectl version v1.11.3+. + +### Setup on kind + +We recommend using kind to create a Kubernetes cluster for local development. + +### Use go v1.24 + +Currently, flyte-v2 use go v1.24 for development. + +```sh +go install golang.org/dl/go1.24.0@latest +go1.24.0 download +export GOROOT=$(go1.24.0 env GOROOT) +export PATH="$GOROOT/bin:$PATH" +``` + +### Clean up local binaries + +To keep consistent code generation and testing result, it is recommended to remove outdated binaries installed by the Makefile. + +```sh +make clean +``` + +## Local development on kind cluster + +Following steps requires you to switch your workign directory to the `executor/`. + +```sh +cd executor +``` + +### Run executor inside the cluster + +1. Create a kind cluster + +```sh +kind create cluster --image=kindest/node:v1.26.0 --name flytev2 +``` + +2. Build the image + +```sh +IMG=flyteorg/executor:nightly make docker-build +``` + +3. Load image into kind cluster + +```sh +kind load docker-image flyteorg/executor:nightly --name flytev2 +``` + +4. Install CRD in to the cluster + +```sh +make install +``` + +5. Deploy the Manager to the cluster with the image specified by `IMG`: + +```sh +make deploy IMG=flyteorg/executor:nightly +``` + +6. Clean up + +```sh +kind delete cluster --name flytev2 +``` + +### Run executor outside the cluster + +1. Create a kind cluster + +```sh +kind create cluster --image=kindest/node:v1.26.0 --name flytev2 +``` + +2. Install CRD in to the cluster + +```sh +make install +``` + +3. Compile the source code and run + +```sh +# Compile the source code +make build +# Run the executor +./bin/manager +``` + +## Tests + +### Manual test + +You can apply the samples from the config/sample using the following command: + +```sh +kubectl apply -k config/samples/ +``` + +You can see the `TaskAction` CRD created: + +```sh +❯ k get taskactions +NAME RUN ACTION STATUS AGE +taskaction-sample sample-run sample-task Completed 59m +``` + +Or use `-o wide` to view more details: + +```sh +❯ k get taskactions -o wide +NAME RUN ACTION STATUS AGE PROGRESSING SUCCEEDED FAILED +taskaction-sample sample-run sample-task Completed 59m False True +``` + +## Modify CRD + +### Quick Steps + +1. Modify the types file: Edit `api/v1/taskaction_types.go` + - Add/modify fields in `TaskActionSpec` or `TaskActionStatus` + - Add/modify printcolumns (the `// +kubebuilder:printcolumn` comments above the `TaskAction` struct) + - Add validation rules using `// +kubebuilder:validation:` markers + +2. Generate CRD manifests and DeepCopy code + +```sh +make manifests generate +``` + +This runs two commands: +- `make manifests`: Updates YAML manifests: + - `config/crd/bases/flyte.org_taskactions.yaml` (CRD with schema, validation, printcolumns) + - `config/rbac/role.yaml` (RBAC permissions) +- `make generate`: Updates Go code: + - `api/v1/zz_generated.deepcopy.go` (DeepCopy methods required by Kubernetes) + +3. Update CRD in the cluster + +```sh +make install +``` diff --git a/executor/Dockerfile b/executor/Dockerfile index 98c3354e38..7f70c66dc2 100644 --- a/executor/Dockerfile +++ b/executor/Dockerfile @@ -5,21 +5,22 @@ ARG TARGETARCH WORKDIR /workspace # Copy the Go Modules manifests -COPY executor/go.mod go.mod -COPY executor/go.sum go.sum +COPY go.mod go.mod +COPY go.sum go.sum # cache deps before building and copying source so that we don't need to re-download as much # and so that source changes don't invalidate our downloaded layer RUN go mod download -# Copy the Go source (relies on .dockerignore to filter) -COPY executor/. . +# Copy only the needed source files from monorepo +COPY executor/ executor/ +COPY gen/ gen/ -# Build +# Build the executor binary # the GOARCH has no default value to allow the binary to be built according to the host where the command # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager executor/cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/executor/Makefile b/executor/Makefile index 0e224c8b94..6e924f19a9 100644 --- a/executor/Makefile +++ b/executor/Makefile @@ -117,7 +117,7 @@ run: manifests generate fmt vet ## Run a controller from your host. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . + $(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile .. .PHONY: docker-push docker-push: ## Push docker image with the manager. @@ -178,6 +178,10 @@ LOCALBIN ?= $(shell pwd)/bin $(LOCALBIN): mkdir -p $(LOCALBIN) +.PHONY: clean +clean: ## Cleanup local binaries such as controller-gen and kustomize + rm -rf $(LOCALBIN) + ## Tool Binaries KUBECTL ?= kubectl KIND ?= kind diff --git a/executor/README.md b/executor/README.md index e5d7d768b8..583215a077 100644 --- a/executor/README.md +++ b/executor/README.md @@ -1,8 +1,20 @@ -# executor -// TODO(user): Add simple overview of use/purpose +# Executor + +The Executor is a Kubernetes operator that manages the execution of Flyte tasks in the data plane. Built using the Kubernetes Operator pattern with `controller-runtime`, it watches and reconciles `TaskAction` custom resources to orchestrate task execution. ## Description -// TODO(user): An in-depth paragraph about your project and overview of use + +The Executor controller is responsible for: +- **Monitoring TaskAction CRs**: Watches for TaskAction resources created in the Kubernetes cluster +- **Task Execution**: Executes tasks based on the specifications defined in TaskAction resources +- **State Management**: Reports task execution state to the State Service +- **Lifecycle Management**: Manages the full lifecycle of task execution from queued to completed/failed states + +The executor uses conditions to track task progress: +- `Progressing`: Indicates active execution (reasons: Queued, Initializing, Executing) +- `Succeeded`: Task completed successfully +- `Failed`: Task execution failed + ## Getting Started @@ -110,8 +122,11 @@ the '--force' flag and manually ensure that any custom configuration previously added to 'dist/chart/values.yaml' or 'dist/chart/manager/manager.yaml' is manually re-applied afterwards. + ## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project + +Please read our [CONTRIBUTING](../CONTRIBUTING.md) guide before making a pull request. Refer to our +[DEVELOPMENT.md](DEVELOPMENT.md) to build and run tests for executor locally. **NOTE:** Run `make help` for more information on all potential `make` targets diff --git a/executor/api/v1/taskaction_types.go b/executor/api/v1/taskaction_types.go index 8b2a9873bc..52452299c6 100644 --- a/executor/api/v1/taskaction_types.go +++ b/executor/api/v1/taskaction_types.go @@ -17,48 +17,140 @@ limitations under the License. package v1 import ( - "fmt" - - "google.golang.org/protobuf/proto" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/common" "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +type ( + TaskActionConditionType string + TaskActionConditionReason string +) + +// Condition type constants +// Following Kubernetes API conventions: +// - Condition types describe the current observed state +// - Use Reason field to track sub-states (like Queued, Initializing, Executing) +const ( + // ConditionTypeProgressing indicates whether the TaskAction is actively progressing. + // This is True when the TaskAction is queued, initializing, or executing. + // This is False when the TaskAction has completed or failed. + ConditionTypeProgressing TaskActionConditionType = "Progressing" + + // ConditionTypeSucceeded indicates whether the TaskAction has completed successfully. + // This is a terminal condition. Once True, the TaskAction will not be reconciled further. + ConditionTypeSucceeded TaskActionConditionType = "Succeeded" + + // ConditionTypeFailed indicates whether the TaskAction has failed. + // This is a terminal condition. Once True, the TaskAction will not be reconciled further. + ConditionTypeFailed TaskActionConditionType = "Failed" +) + +// Condition reason constants +// Reasons explain why a condition has a particular status. +// These are used in the Reason field of conditions to provide detailed sub-state information. +const ( + // ConditionReasonQueued indicates the TaskAction is queued and waiting for resources + ConditionReasonQueued TaskActionConditionReason = "Queued" + + // ConditionReasonInitializing indicates the TaskAction is being initialized + ConditionReasonInitializing TaskActionConditionReason = "Initializing" + + // ConditionReasonExecuting indicates the TaskAction is actively executing + ConditionReasonExecuting TaskActionConditionReason = "Executing" + + // ConditionReasonCompleted indicates the TaskAction has completed successfully + ConditionReasonCompleted TaskActionConditionReason = "Completed" +) + // TaskActionSpec defines the desired state of TaskAction type TaskActionSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - // The following markers will use OpenAPI v3 schema to validate the value - // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html - - // foo is an example field of TaskAction. Edit taskaction_types.go to remove/update + // RunName is the name of the run this action belongs to + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=30 + RunName string `json:"runName"` + + // Org this action belongs to + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + Org string `json:"org"` + + // Project this action belongs to + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + Project string `json:"project"` + + // Domain this action belongs to + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + Domain string `json:"domain"` + + // ActionName is the unique name of this action within the run + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=30 + ActionName string `json:"actionName"` + + // ParentActionName is the optional name of the parent action // +optional - TaskActionBytes []byte `json:"taskActionBytes,omitempty"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=30 + ParentActionName *string `json:"parentActionName,omitempty"` + + // InputURI is the path to the input data for this action + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + InputURI string `json:"inputUri"` + + // RunOutputBase is the base path where this action should write its output + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + RunOutputBase string `json:"runOutputBase"` } func (in *TaskActionSpec) GetActionSpec() (*workflow.ActionSpec, error) { - // Unmarshal from bytes to ActionSpec - spec := &workflow.ActionSpec{} - if in.TaskActionBytes != nil { - if err := proto.Unmarshal(in.TaskActionBytes, spec); err != nil { - return nil, fmt.Errorf("error unmarshalling TaskAction spec: %w", err) - } + // Build ActionSpec from structured fields + spec := &workflow.ActionSpec{ + ActionId: &common.ActionIdentifier{ + Run: &common.RunIdentifier{ + Org: in.Org, + Project: in.Project, + Domain: in.Domain, + Name: in.RunName, + }, + Name: in.ActionName, + }, + ParentActionName: in.ParentActionName, + InputUri: in.InputURI, + RunOutputBase: in.RunOutputBase, } return spec, nil } func (in *TaskActionSpec) SetActionSpec(spec *workflow.ActionSpec) error { - raw, err := proto.Marshal(spec) - if err != nil { - return fmt.Errorf("error marshalling TaskAction spec: %w", err) + // Populate structured fields from ActionSpec + if spec.ActionId != nil { + if spec.ActionId.Run != nil { + in.Org = spec.ActionId.Run.Org + in.Project = spec.ActionId.Run.Project + in.Domain = spec.ActionId.Run.Domain + in.RunName = spec.ActionId.Run.Name + } + in.ActionName = spec.ActionId.Name } + in.ParentActionName = spec.ParentActionName + in.InputURI = spec.InputUri + in.RunOutputBase = spec.RunOutputBase - in.TaskActionBytes = raw return nil } @@ -70,18 +162,10 @@ type TaskActionStatus struct { // For Kubernetes API conventions, see: // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties - // Phase represents the current phase of the TaskAction execution - // +optional - Phase string `json:"phase,omitempty"` - // StateJSON is the JSON serialized NodeStatus that was last sent to the State Service // +optional StateJSON string `json:"stateJson,omitempty"` - // Message provides additional information about the current state - // +optional - Message string `json:"message,omitempty"` - // conditions represent the current state of the TaskAction resource. // Each condition has a unique type and reflects the status of a specific aspect of the resource. // @@ -99,9 +183,13 @@ type TaskActionStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` -// +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.message` +// +kubebuilder:printcolumn:name="Run",type="string",JSONPath=".spec.runName" +// +kubebuilder:printcolumn:name="Action",type="string",JSONPath=".spec.actionName" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type=='Progressing')].reason" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="Progressing",type="string",JSONPath=".status.conditions[?(@.type=='Progressing')].status",priority=1 +// +kubebuilder:printcolumn:name="Succeeded",type="string",JSONPath=".status.conditions[?(@.type=='Succeeded')].status",priority=1 +// +kubebuilder:printcolumn:name="Failed",type="string",JSONPath=".status.conditions[?(@.type=='Failed')].status",priority=1 // TaskAction is the Schema for the taskactions API type TaskAction struct { diff --git a/executor/api/v1/zz_generated.deepcopy.go b/executor/api/v1/zz_generated.deepcopy.go index e228fc2d7e..a5627c610f 100644 --- a/executor/api/v1/zz_generated.deepcopy.go +++ b/executor/api/v1/zz_generated.deepcopy.go @@ -87,10 +87,10 @@ func (in *TaskActionList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TaskActionSpec) DeepCopyInto(out *TaskActionSpec) { *out = *in - if in.TaskActionBytes != nil { - in, out := &in.TaskActionBytes, &out.TaskActionBytes - *out = make([]byte, len(*in)) - copy(*out, *in) + if in.ParentActionName != nil { + in, out := &in.ParentActionName, &out.ParentActionName + *out = new(string) + **out = **in } } diff --git a/executor/config/crd/bases/flyte.org_taskactions.yaml b/executor/config/crd/bases/flyte.org_taskactions.yaml index e382bc2122..5cb943cd3f 100644 --- a/executor/config/crd/bases/flyte.org_taskactions.yaml +++ b/executor/config/crd/bases/flyte.org_taskactions.yaml @@ -15,15 +15,30 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .status.phase - name: Phase + - jsonPath: .spec.runName + name: Run type: string - - jsonPath: .status.message - name: Message + - jsonPath: .spec.actionName + name: Action + type: string + - jsonPath: .status.conditions[?(@.type=='Progressing')].reason + name: Status type: string - jsonPath: .metadata.creationTimestamp name: Age type: date + - jsonPath: .status.conditions[?(@.type=='Progressing')].status + name: Progressing + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=='Succeeded')].status + name: Succeeded + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=='Failed')].status + name: Failed + priority: 1 + type: string name: v1 schema: openAPIV3Schema: @@ -49,11 +64,54 @@ spec: spec: description: spec defines the desired state of TaskAction properties: - taskActionBytes: - description: foo is an example field of TaskAction. Edit taskaction_types.go - to remove/update - format: byte + actionName: + description: ActionName is the unique name of this action within the + run + maxLength: 30 + minLength: 1 + type: string + domain: + description: Domain this action belongs to + maxLength: 63 + minLength: 1 + type: string + inputUri: + description: InputURI is the path to the input data for this action + minLength: 1 + type: string + org: + description: Org this action belongs to + maxLength: 63 + minLength: 1 type: string + parentActionName: + description: ParentActionName is the optional name of the parent action + maxLength: 30 + minLength: 1 + type: string + project: + description: Project this action belongs to + maxLength: 63 + minLength: 1 + type: string + runName: + description: RunName is the name of the run this action belongs to + maxLength: 30 + minLength: 1 + type: string + runOutputBase: + description: RunOutputBase is the base path where this action should + write its output + minLength: 1 + type: string + required: + - actionName + - domain + - inputUri + - org + - project + - runName + - runOutputBase type: object status: description: status defines the observed state of TaskAction @@ -127,14 +185,6 @@ spec: x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map - message: - description: Message provides additional information about the current - state - type: string - phase: - description: Phase represents the current phase of the TaskAction - execution - type: string stateJson: description: StateJSON is the JSON serialized NodeStatus that was last sent to the State Service diff --git a/executor/config/manager/kustomization.yaml b/executor/config/manager/kustomization.yaml index ad13e96b3f..c0049bde09 100644 --- a/executor/config/manager/kustomization.yaml +++ b/executor/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: controller - newTag: latest + newName: flyteorg/executor + newTag: nightly diff --git a/executor/config/samples/flyte.org_v1_taskaction.yaml b/executor/config/samples/flyte.org_v1_taskaction.yaml index 9ef13f2df0..d53f870f1c 100644 --- a/executor/config/samples/flyte.org_v1_taskaction.yaml +++ b/executor/config/samples/flyte.org_v1_taskaction.yaml @@ -6,4 +6,10 @@ metadata: app.kubernetes.io/managed-by: kustomize name: taskaction-sample spec: - # TODO(user): Add fields here + runName: "sample-run" + org: "demo" + project: "default" + domain: "dev" + actionName: "sample-task" + inputUri: "/tmp/input" + runOutputBase: "/tmp/output" diff --git a/executor/pkg/controller/taskaction_controller.go b/executor/pkg/controller/taskaction_controller.go index 17cdd7bcba..bcc280b899 100644 --- a/executor/pkg/controller/taskaction_controller.go +++ b/executor/pkg/controller/taskaction_controller.go @@ -27,8 +27,11 @@ import ( "connectrpc.com/connect" "golang.org/x/net/http2" - "k8s.io/apimachinery/pkg/api/errors" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/record" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,12 +42,20 @@ import ( "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow/workflowconnect" ) +type K8sEventType string + +const ( + TaskActionDefaultRequeueDuration = 5 * time.Second + FailedUnmarshal K8sEventType = "FailedUnmarshal" +) + // TaskActionReconciler reconciles a TaskAction object type TaskActionReconciler struct { client.Client Scheme *runtime.Scheme StateServiceURL string stateServiceClient workflowconnect.StateServiceClient + Recorder record.EventRecorder } // NewTaskActionReconciler creates a new TaskActionReconciler with initialized clients @@ -71,16 +82,6 @@ func NewTaskActionReconciler(c client.Client, scheme *runtime.Scheme, stateServi } } -// Phase constants -const ( - PhaseQueued = "PHASE_QUEUED" - PhaseInitializing = "PHASE_INITIALIZING" - PhaseRunning = "PHASE_RUNNING" - PhaseSucceeded = "PHASE_SUCCEEDED" - PhaseFailed = "PHASE_FAILED" - PhaseAborted = "PHASE_ABORTED" -) - // +kubebuilder:rbac:groups=flyte.org,resources=taskactions,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=flyte.org,resources=taskactions/status,verbs=get;update;patch // +kubebuilder:rbac:groups=flyte.org,resources=taskactions/finalizers,verbs=update @@ -93,98 +94,120 @@ func (r *TaskActionReconciler) Reconcile(ctx context.Context, req ctrl.Request) // Fetch the TaskAction instance taskAction := &flyteorgv1.TaskAction{} if err := r.Get(ctx, req.NamespacedName, taskAction); err != nil { - if errors.IsNotFound(err) { - // TaskAction was deleted - logger.Info("TaskAction not found, likely deleted", "name", req.NamespacedName) - return ctrl.Result{}, nil - } - logger.Error(err, "Failed to get TaskAction") - return ctrl.Result{}, err + return ctrl.Result{}, client.IgnoreNotFound(err) } // Get the ActionSpec from the TaskAction actionSpec, err := taskAction.Spec.GetActionSpec() if err != nil { - logger.Error(err, "Failed to unmarshal ActionSpec") + r.Recorder.Eventf(taskAction, corev1.EventTypeWarning, string(FailedUnmarshal), "Failed to unmarshal ActionSpec %s/%s: %v", taskAction.Namespace, taskAction.Name, err) return ctrl.Result{}, err } - // Determine current phase (default to empty if new) - currentPhase := taskAction.Status.Phase - - // State machine logic - var nextPhase string - var requeueAfter time.Duration - // TODO (haytham): Remove when we add real code that executes plugins. For now this is here so that watchers can see // things transition between states. time.Sleep(2 * time.Second) - switch currentPhase { - case "": - // New TaskAction - transition to Queued - nextPhase = PhaseQueued - logger.Info("New TaskAction detected, transitioning to Queued", - "name", taskAction.Name, "action", actionSpec.ActionId.Name) - case PhaseQueued: - // Queued → Initializing - nextPhase = PhaseInitializing - logger.Info("Transitioning from Queued to Initializing", + // Check terminal conditions first + succeededCond := findConditionByType(taskAction.Status.Conditions, flyteorgv1.ConditionTypeSucceeded) + if succeededCond != nil && succeededCond.Status == metav1.ConditionTrue { + logger.Info("TaskAction already succeeded", "name", taskAction.Name, "action", actionSpec.ActionId.Name) + return ctrl.Result{}, nil + } - case PhaseInitializing: - // Initializing → Running - nextPhase = PhaseRunning - logger.Info("Transitioning from Initializing to Running", + failedCond := findConditionByType(taskAction.Status.Conditions, flyteorgv1.ConditionTypeFailed) + if failedCond != nil && failedCond.Status == metav1.ConditionTrue { + logger.Info("TaskAction already failed", "name", taskAction.Name, "action", actionSpec.ActionId.Name) + return ctrl.Result{}, nil + } - case PhaseRunning: - // Running → Succeeded (simulated execution) - nextPhase = PhaseSucceeded - logger.Info("Transitioning from Running to Succeeded", - "name", taskAction.Name, "action", actionSpec.ActionId.Name) + // Sequential condition evaluation for Progressing + progressingCond := findConditionByType(taskAction.Status.Conditions, flyteorgv1.ConditionTypeProgressing) + if progressingCond != nil && progressingCond.Status == metav1.ConditionTrue { + // Check the Reason to determine sub-state + if progressingCond.Reason == string(flyteorgv1.ConditionReasonExecuting) { + // Executing to Succeeded + logger.Info("TaskAction is executing, transitioning to Succeeded", + "name", taskAction.Name, "action", actionSpec.ActionId.Name) + + setCondition(taskAction, flyteorgv1.ConditionTypeProgressing, metav1.ConditionFalse, + flyteorgv1.ConditionReasonCompleted, "TaskAction has completed") + setCondition(taskAction, flyteorgv1.ConditionTypeSucceeded, metav1.ConditionTrue, + flyteorgv1.ConditionReasonCompleted, "TaskAction completed successfully") + + stateJSON := r.createStateJSON(actionSpec, "Succeeded") + if err := r.updateStateService(ctx, actionSpec.ActionId, actionSpec.ParentActionName, stateJSON); err != nil { + logger.Error(err, "Failed to update state service") + } + taskAction.Status.StateJSON = stateJSON + + if err := r.Status().Update(ctx, taskAction); err != nil { + return ctrl.Result{}, err + } + return ctrl.Result{}, nil + } - case PhaseSucceeded, PhaseFailed, PhaseAborted: - // Terminal states - no further transitions - logger.Info("TaskAction in terminal state", - "name", taskAction.Name, "phase", currentPhase) - return ctrl.Result{}, nil + if progressingCond.Reason == string(flyteorgv1.ConditionReasonInitializing) { + // Initializing to Executing + logger.Info("TaskAction is initializing, transitioning to Executing", + "name", taskAction.Name, "action", actionSpec.ActionId.Name) + + setCondition(taskAction, flyteorgv1.ConditionTypeProgressing, metav1.ConditionTrue, + flyteorgv1.ConditionReasonExecuting, "TaskAction is executing") - default: - logger.Info("Unknown phase, resetting to Queued", - "name", taskAction.Name, "phase", currentPhase) - nextPhase = PhaseQueued + stateJSON := r.createStateJSON(actionSpec, "Running") + if err := r.updateStateService(ctx, actionSpec.ActionId, actionSpec.ParentActionName, stateJSON); err != nil { + logger.Error(err, "Failed to update state service") + } + taskAction.Status.StateJSON = stateJSON + + if err := r.Status().Update(ctx, taskAction); err != nil { + return ctrl.Result{}, err + } + return ctrl.Result{RequeueAfter: 5 * time.Second}, nil + } + + if progressingCond.Reason == string(flyteorgv1.ConditionReasonQueued) { + // Queued to Initializing + logger.Info("TaskAction is queued, transitioning to Initializing", + "name", taskAction.Name, "action", actionSpec.ActionId.Name) + + setCondition(taskAction, flyteorgv1.ConditionTypeProgressing, metav1.ConditionTrue, + flyteorgv1.ConditionReasonInitializing, "TaskAction is being initialized") + + stateJSON := r.createStateJSON(actionSpec, "Initializing") + if err := r.updateStateService(ctx, actionSpec.ActionId, actionSpec.ParentActionName, stateJSON); err != nil { + logger.Error(err, "Failed to update state service") + } + taskAction.Status.StateJSON = stateJSON + + if err := r.Status().Update(ctx, taskAction); err != nil { + return ctrl.Result{}, err + } + return ctrl.Result{RequeueAfter: 5 * time.Second}, nil + } } - // Create state JSON (simplified NodeStatus) - stateJSON := r.createStateJSON(actionSpec, nextPhase) + // No conditions exist, this is the first reconcile + // Set Condition to Queued + logger.Info("New TaskAction, setting Progressing condition", + "name", taskAction.Name, "action", actionSpec.ActionId.Name) + + setCondition(taskAction, flyteorgv1.ConditionTypeProgressing, metav1.ConditionTrue, + flyteorgv1.ConditionReasonQueued, "TaskAction is queued and waiting for resources") - // Send state update to State Service + stateJSON := r.createStateJSON(actionSpec, "Queued") if err := r.updateStateService(ctx, actionSpec.ActionId, actionSpec.ParentActionName, stateJSON); err != nil { - logger.Error(err, "Failed to update state service", "phase", nextPhase) - // Continue anyway - we'll try again on next reconcile + logger.Error(err, "Failed to update state service") } - - // Update TaskAction status - taskAction.Status.Phase = nextPhase taskAction.Status.StateJSON = stateJSON - taskAction.Status.Message = fmt.Sprintf("Transitioned to %s", nextPhase) if err := r.Status().Update(ctx, taskAction); err != nil { - logger.Error(err, "Failed to update TaskAction status") return ctrl.Result{}, err } - - logger.Info("Successfully updated TaskAction status", - "name", taskAction.Name, "phase", nextPhase) - - // Requeue after a delay to simulate state transitions - // For non-terminal states, requeue after 5 seconds - if nextPhase != PhaseSucceeded && nextPhase != PhaseFailed && nextPhase != PhaseAborted { - requeueAfter = 5 * time.Second - } - - return ctrl.Result{RequeueAfter: requeueAfter}, nil + return ctrl.Result{RequeueAfter: TaskActionDefaultRequeueDuration}, nil } // createStateJSON creates a simplified NodeStatus JSON representation @@ -234,3 +257,25 @@ func (r *TaskActionReconciler) SetupWithManager(mgr ctrl.Manager) error { Named("taskaction"). Complete(r) } + +// findConditionByType finds a condition by type in the conditions list +// Returns nil if not found +func findConditionByType(conditions []metav1.Condition, condType flyteorgv1.TaskActionConditionType) *metav1.Condition { + for i := range conditions { + if conditions[i].Type == string(condType) { + return &conditions[i] + } + } + return nil +} + +// setCondition sets or updates a condition on the TaskAction +func setCondition(taskAction *flyteorgv1.TaskAction, conditionType flyteorgv1.TaskActionConditionType, status metav1.ConditionStatus, reason flyteorgv1.TaskActionConditionReason, message string) { + condition := metav1.Condition{ + Type: string(conditionType), + Status: status, + Reason: string(reason), + Message: message, + } + meta.SetStatusCondition(&taskAction.Status.Conditions, condition) +} diff --git a/executor/pkg/controller/taskaction_controller_test.go b/executor/pkg/controller/taskaction_controller_test.go index a94cfdbb6c..4a00c23182 100644 --- a/executor/pkg/controller/taskaction_controller_test.go +++ b/executor/pkg/controller/taskaction_controller_test.go @@ -19,14 +19,19 @@ package controller import ( "context" + "connectrpc.com/connect" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/stretchr/testify/mock" + rpcstatus "google.golang.org/genproto/googleapis/rpc/status" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/reconcile" flyteorgv1 "github.com/flyteorg/flyte/v2/executor/api/v1" + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" + workflowconnectmocks "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow/workflowconnect/mocks" ) var _ = Describe("TaskAction Controller", func() { @@ -50,7 +55,15 @@ var _ = Describe("TaskAction Controller", func() { Name: resourceName, Namespace: "default", }, - // TODO(user): Specify other spec details if needed. + Spec: flyteorgv1.TaskActionSpec{ + RunName: "test-run", + Org: "test-org", + Project: "test-project", + Domain: "test-domain", + ActionName: "test-action", + InputURI: "/tmp/input", + RunOutputBase: "/tmp/output", + }, } Expect(k8sClient.Create(ctx, resource)).To(Succeed()) } @@ -67,17 +80,36 @@ var _ = Describe("TaskAction Controller", func() { }) It("should successfully reconcile the resource", func() { By("Reconciling the created resource") + + // Create a mock state service client + mockClient := &workflowconnectmocks.StateServiceClient{} + + // Set up expectations for Put calls - return a proper response with status + mockClient.On("Put", mock.Anything, mock.Anything). + Return(connect.NewResponse(&workflow.PutResponse{ + Status: &rpcstatus.Status{ + Code: 0, + Message: "success", + }, + }), nil). + Maybe() + controllerReconciler := &TaskActionReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), + Client: k8sClient, + Scheme: k8sClient.Scheme(), + stateServiceClient: mockClient, } _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ NamespacedName: typeNamespacedName, }) Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. + + // Verify that the TaskAction was updated with a condition + updatedTaskAction := &flyteorgv1.TaskAction{} + err = k8sClient.Get(ctx, typeNamespacedName, updatedTaskAction) + Expect(err).NotTo(HaveOccurred()) + Expect(updatedTaskAction.Status.Conditions).NotTo(BeEmpty()) }) }) }) diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceClient.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceClient.go new file mode 100644 index 0000000000..c52e5af0eb --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceClient.go @@ -0,0 +1,217 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// QueueServiceClient is an autogenerated mock type for the QueueServiceClient type +type QueueServiceClient struct { + mock.Mock +} + +type QueueServiceClient_Expecter struct { + mock *mock.Mock +} + +func (_m *QueueServiceClient) EXPECT() *QueueServiceClient_Expecter { + return &QueueServiceClient_Expecter{mock: &_m.Mock} +} + +// AbortQueuedAction provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceClient) AbortQueuedAction(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortQueuedAction") + } + + var r0 *connect.Response[workflow.AbortQueuedActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) *connect.Response[workflow.AbortQueuedActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortQueuedActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceClient_AbortQueuedAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortQueuedAction' +type QueueServiceClient_AbortQueuedAction_Call struct { + *mock.Call +} + +// AbortQueuedAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortQueuedActionRequest] +func (_e *QueueServiceClient_Expecter) AbortQueuedAction(_a0 interface{}, _a1 interface{}) *QueueServiceClient_AbortQueuedAction_Call { + return &QueueServiceClient_AbortQueuedAction_Call{Call: _e.mock.On("AbortQueuedAction", _a0, _a1)} +} + +func (_c *QueueServiceClient_AbortQueuedAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedActionRequest])) *QueueServiceClient_AbortQueuedAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortQueuedActionRequest])) + }) + return _c +} + +func (_c *QueueServiceClient_AbortQueuedAction_Call) Return(_a0 *connect.Response[workflow.AbortQueuedActionResponse], _a1 error) *QueueServiceClient_AbortQueuedAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceClient_AbortQueuedAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error)) *QueueServiceClient_AbortQueuedAction_Call { + _c.Call.Return(run) + return _c +} + +// AbortQueuedRun provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceClient) AbortQueuedRun(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortQueuedRun") + } + + var r0 *connect.Response[workflow.AbortQueuedRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) *connect.Response[workflow.AbortQueuedRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortQueuedRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceClient_AbortQueuedRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortQueuedRun' +type QueueServiceClient_AbortQueuedRun_Call struct { + *mock.Call +} + +// AbortQueuedRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortQueuedRunRequest] +func (_e *QueueServiceClient_Expecter) AbortQueuedRun(_a0 interface{}, _a1 interface{}) *QueueServiceClient_AbortQueuedRun_Call { + return &QueueServiceClient_AbortQueuedRun_Call{Call: _e.mock.On("AbortQueuedRun", _a0, _a1)} +} + +func (_c *QueueServiceClient_AbortQueuedRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedRunRequest])) *QueueServiceClient_AbortQueuedRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortQueuedRunRequest])) + }) + return _c +} + +func (_c *QueueServiceClient_AbortQueuedRun_Call) Return(_a0 *connect.Response[workflow.AbortQueuedRunResponse], _a1 error) *QueueServiceClient_AbortQueuedRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceClient_AbortQueuedRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error)) *QueueServiceClient_AbortQueuedRun_Call { + _c.Call.Return(run) + return _c +} + +// EnqueueAction provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceClient) EnqueueAction(_a0 context.Context, _a1 *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for EnqueueAction") + } + + var r0 *connect.Response[workflow.EnqueueActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) *connect.Response[workflow.EnqueueActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.EnqueueActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceClient_EnqueueAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnqueueAction' +type QueueServiceClient_EnqueueAction_Call struct { + *mock.Call +} + +// EnqueueAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.EnqueueActionRequest] +func (_e *QueueServiceClient_Expecter) EnqueueAction(_a0 interface{}, _a1 interface{}) *QueueServiceClient_EnqueueAction_Call { + return &QueueServiceClient_EnqueueAction_Call{Call: _e.mock.On("EnqueueAction", _a0, _a1)} +} + +func (_c *QueueServiceClient_EnqueueAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.EnqueueActionRequest])) *QueueServiceClient_EnqueueAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.EnqueueActionRequest])) + }) + return _c +} + +func (_c *QueueServiceClient_EnqueueAction_Call) Return(_a0 *connect.Response[workflow.EnqueueActionResponse], _a1 error) *QueueServiceClient_EnqueueAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceClient_EnqueueAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error)) *QueueServiceClient_EnqueueAction_Call { + _c.Call.Return(run) + return _c +} + +// NewQueueServiceClient creates a new instance of QueueServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewQueueServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *QueueServiceClient { + mock := &QueueServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceHandler.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceHandler.go new file mode 100644 index 0000000000..6e3b2c136e --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_QueueServiceHandler.go @@ -0,0 +1,217 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// QueueServiceHandler is an autogenerated mock type for the QueueServiceHandler type +type QueueServiceHandler struct { + mock.Mock +} + +type QueueServiceHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *QueueServiceHandler) EXPECT() *QueueServiceHandler_Expecter { + return &QueueServiceHandler_Expecter{mock: &_m.Mock} +} + +// AbortQueuedAction provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceHandler) AbortQueuedAction(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortQueuedAction") + } + + var r0 *connect.Response[workflow.AbortQueuedActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) *connect.Response[workflow.AbortQueuedActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortQueuedActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceHandler_AbortQueuedAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortQueuedAction' +type QueueServiceHandler_AbortQueuedAction_Call struct { + *mock.Call +} + +// AbortQueuedAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortQueuedActionRequest] +func (_e *QueueServiceHandler_Expecter) AbortQueuedAction(_a0 interface{}, _a1 interface{}) *QueueServiceHandler_AbortQueuedAction_Call { + return &QueueServiceHandler_AbortQueuedAction_Call{Call: _e.mock.On("AbortQueuedAction", _a0, _a1)} +} + +func (_c *QueueServiceHandler_AbortQueuedAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedActionRequest])) *QueueServiceHandler_AbortQueuedAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortQueuedActionRequest])) + }) + return _c +} + +func (_c *QueueServiceHandler_AbortQueuedAction_Call) Return(_a0 *connect.Response[workflow.AbortQueuedActionResponse], _a1 error) *QueueServiceHandler_AbortQueuedAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceHandler_AbortQueuedAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortQueuedActionRequest]) (*connect.Response[workflow.AbortQueuedActionResponse], error)) *QueueServiceHandler_AbortQueuedAction_Call { + _c.Call.Return(run) + return _c +} + +// AbortQueuedRun provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceHandler) AbortQueuedRun(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortQueuedRun") + } + + var r0 *connect.Response[workflow.AbortQueuedRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) *connect.Response[workflow.AbortQueuedRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortQueuedRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceHandler_AbortQueuedRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortQueuedRun' +type QueueServiceHandler_AbortQueuedRun_Call struct { + *mock.Call +} + +// AbortQueuedRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortQueuedRunRequest] +func (_e *QueueServiceHandler_Expecter) AbortQueuedRun(_a0 interface{}, _a1 interface{}) *QueueServiceHandler_AbortQueuedRun_Call { + return &QueueServiceHandler_AbortQueuedRun_Call{Call: _e.mock.On("AbortQueuedRun", _a0, _a1)} +} + +func (_c *QueueServiceHandler_AbortQueuedRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortQueuedRunRequest])) *QueueServiceHandler_AbortQueuedRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortQueuedRunRequest])) + }) + return _c +} + +func (_c *QueueServiceHandler_AbortQueuedRun_Call) Return(_a0 *connect.Response[workflow.AbortQueuedRunResponse], _a1 error) *QueueServiceHandler_AbortQueuedRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceHandler_AbortQueuedRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortQueuedRunRequest]) (*connect.Response[workflow.AbortQueuedRunResponse], error)) *QueueServiceHandler_AbortQueuedRun_Call { + _c.Call.Return(run) + return _c +} + +// EnqueueAction provides a mock function with given fields: _a0, _a1 +func (_m *QueueServiceHandler) EnqueueAction(_a0 context.Context, _a1 *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for EnqueueAction") + } + + var r0 *connect.Response[workflow.EnqueueActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) *connect.Response[workflow.EnqueueActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.EnqueueActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueueServiceHandler_EnqueueAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnqueueAction' +type QueueServiceHandler_EnqueueAction_Call struct { + *mock.Call +} + +// EnqueueAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.EnqueueActionRequest] +func (_e *QueueServiceHandler_Expecter) EnqueueAction(_a0 interface{}, _a1 interface{}) *QueueServiceHandler_EnqueueAction_Call { + return &QueueServiceHandler_EnqueueAction_Call{Call: _e.mock.On("EnqueueAction", _a0, _a1)} +} + +func (_c *QueueServiceHandler_EnqueueAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.EnqueueActionRequest])) *QueueServiceHandler_EnqueueAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.EnqueueActionRequest])) + }) + return _c +} + +func (_c *QueueServiceHandler_EnqueueAction_Call) Return(_a0 *connect.Response[workflow.EnqueueActionResponse], _a1 error) *QueueServiceHandler_EnqueueAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueueServiceHandler_EnqueueAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.EnqueueActionRequest]) (*connect.Response[workflow.EnqueueActionResponse], error)) *QueueServiceHandler_EnqueueAction_Call { + _c.Call.Return(run) + return _c +} + +// NewQueueServiceHandler creates a new instance of QueueServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewQueueServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *QueueServiceHandler { + mock := &QueueServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceClient.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceClient.go new file mode 100644 index 0000000000..ec1e597f1e --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceClient.go @@ -0,0 +1,99 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// RunLogsServiceClient is an autogenerated mock type for the RunLogsServiceClient type +type RunLogsServiceClient struct { + mock.Mock +} + +type RunLogsServiceClient_Expecter struct { + mock *mock.Mock +} + +func (_m *RunLogsServiceClient) EXPECT() *RunLogsServiceClient_Expecter { + return &RunLogsServiceClient_Expecter{mock: &_m.Mock} +} + +// TailLogs provides a mock function with given fields: _a0, _a1 +func (_m *RunLogsServiceClient) TailLogs(_a0 context.Context, _a1 *connect.Request[workflow.TailLogsRequest]) (*connect.ServerStreamForClient[workflow.TailLogsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for TailLogs") + } + + var r0 *connect.ServerStreamForClient[workflow.TailLogsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TailLogsRequest]) (*connect.ServerStreamForClient[workflow.TailLogsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TailLogsRequest]) *connect.ServerStreamForClient[workflow.TailLogsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.TailLogsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.TailLogsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunLogsServiceClient_TailLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TailLogs' +type RunLogsServiceClient_TailLogs_Call struct { + *mock.Call +} + +// TailLogs is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.TailLogsRequest] +func (_e *RunLogsServiceClient_Expecter) TailLogs(_a0 interface{}, _a1 interface{}) *RunLogsServiceClient_TailLogs_Call { + return &RunLogsServiceClient_TailLogs_Call{Call: _e.mock.On("TailLogs", _a0, _a1)} +} + +func (_c *RunLogsServiceClient_TailLogs_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.TailLogsRequest])) *RunLogsServiceClient_TailLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.TailLogsRequest])) + }) + return _c +} + +func (_c *RunLogsServiceClient_TailLogs_Call) Return(_a0 *connect.ServerStreamForClient[workflow.TailLogsResponse], _a1 error) *RunLogsServiceClient_TailLogs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunLogsServiceClient_TailLogs_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.TailLogsRequest]) (*connect.ServerStreamForClient[workflow.TailLogsResponse], error)) *RunLogsServiceClient_TailLogs_Call { + _c.Call.Return(run) + return _c +} + +// NewRunLogsServiceClient creates a new instance of RunLogsServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRunLogsServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *RunLogsServiceClient { + mock := &RunLogsServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceHandler.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceHandler.go new file mode 100644 index 0000000000..7a4844f575 --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunLogsServiceHandler.go @@ -0,0 +1,88 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// RunLogsServiceHandler is an autogenerated mock type for the RunLogsServiceHandler type +type RunLogsServiceHandler struct { + mock.Mock +} + +type RunLogsServiceHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *RunLogsServiceHandler) EXPECT() *RunLogsServiceHandler_Expecter { + return &RunLogsServiceHandler_Expecter{mock: &_m.Mock} +} + +// TailLogs provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunLogsServiceHandler) TailLogs(_a0 context.Context, _a1 *connect.Request[workflow.TailLogsRequest], _a2 *connect.ServerStream[workflow.TailLogsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for TailLogs") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TailLogsRequest], *connect.ServerStream[workflow.TailLogsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunLogsServiceHandler_TailLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TailLogs' +type RunLogsServiceHandler_TailLogs_Call struct { + *mock.Call +} + +// TailLogs is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.TailLogsRequest] +// - _a2 *connect.ServerStream[workflow.TailLogsResponse] +func (_e *RunLogsServiceHandler_Expecter) TailLogs(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunLogsServiceHandler_TailLogs_Call { + return &RunLogsServiceHandler_TailLogs_Call{Call: _e.mock.On("TailLogs", _a0, _a1, _a2)} +} + +func (_c *RunLogsServiceHandler_TailLogs_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.TailLogsRequest], _a2 *connect.ServerStream[workflow.TailLogsResponse])) *RunLogsServiceHandler_TailLogs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.TailLogsRequest]), args[2].(*connect.ServerStream[workflow.TailLogsResponse])) + }) + return _c +} + +func (_c *RunLogsServiceHandler_TailLogs_Call) Return(_a0 error) *RunLogsServiceHandler_TailLogs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunLogsServiceHandler_TailLogs_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.TailLogsRequest], *connect.ServerStream[workflow.TailLogsResponse]) error) *RunLogsServiceHandler_TailLogs_Call { + _c.Call.Return(run) + return _c +} + +// NewRunLogsServiceHandler creates a new instance of RunLogsServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRunLogsServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *RunLogsServiceHandler { + mock := &RunLogsServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceClient.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceClient.go new file mode 100644 index 0000000000..1d96ec67b4 --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceClient.go @@ -0,0 +1,866 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// RunServiceClient is an autogenerated mock type for the RunServiceClient type +type RunServiceClient struct { + mock.Mock +} + +type RunServiceClient_Expecter struct { + mock *mock.Mock +} + +func (_m *RunServiceClient) EXPECT() *RunServiceClient_Expecter { + return &RunServiceClient_Expecter{mock: &_m.Mock} +} + +// AbortAction provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) AbortAction(_a0 context.Context, _a1 *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortAction") + } + + var r0 *connect.Response[workflow.AbortActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) *connect.Response[workflow.AbortActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_AbortAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortAction' +type RunServiceClient_AbortAction_Call struct { + *mock.Call +} + +// AbortAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortActionRequest] +func (_e *RunServiceClient_Expecter) AbortAction(_a0 interface{}, _a1 interface{}) *RunServiceClient_AbortAction_Call { + return &RunServiceClient_AbortAction_Call{Call: _e.mock.On("AbortAction", _a0, _a1)} +} + +func (_c *RunServiceClient_AbortAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortActionRequest])) *RunServiceClient_AbortAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortActionRequest])) + }) + return _c +} + +func (_c *RunServiceClient_AbortAction_Call) Return(_a0 *connect.Response[workflow.AbortActionResponse], _a1 error) *RunServiceClient_AbortAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_AbortAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error)) *RunServiceClient_AbortAction_Call { + _c.Call.Return(run) + return _c +} + +// AbortRun provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) AbortRun(_a0 context.Context, _a1 *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortRun") + } + + var r0 *connect.Response[workflow.AbortRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) *connect.Response[workflow.AbortRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_AbortRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortRun' +type RunServiceClient_AbortRun_Call struct { + *mock.Call +} + +// AbortRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortRunRequest] +func (_e *RunServiceClient_Expecter) AbortRun(_a0 interface{}, _a1 interface{}) *RunServiceClient_AbortRun_Call { + return &RunServiceClient_AbortRun_Call{Call: _e.mock.On("AbortRun", _a0, _a1)} +} + +func (_c *RunServiceClient_AbortRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortRunRequest])) *RunServiceClient_AbortRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortRunRequest])) + }) + return _c +} + +func (_c *RunServiceClient_AbortRun_Call) Return(_a0 *connect.Response[workflow.AbortRunResponse], _a1 error) *RunServiceClient_AbortRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_AbortRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error)) *RunServiceClient_AbortRun_Call { + _c.Call.Return(run) + return _c +} + +// CreateRun provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) CreateRun(_a0 context.Context, _a1 *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for CreateRun") + } + + var r0 *connect.Response[workflow.CreateRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) *connect.Response[workflow.CreateRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.CreateRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_CreateRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRun' +type RunServiceClient_CreateRun_Call struct { + *mock.Call +} + +// CreateRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.CreateRunRequest] +func (_e *RunServiceClient_Expecter) CreateRun(_a0 interface{}, _a1 interface{}) *RunServiceClient_CreateRun_Call { + return &RunServiceClient_CreateRun_Call{Call: _e.mock.On("CreateRun", _a0, _a1)} +} + +func (_c *RunServiceClient_CreateRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.CreateRunRequest])) *RunServiceClient_CreateRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.CreateRunRequest])) + }) + return _c +} + +func (_c *RunServiceClient_CreateRun_Call) Return(_a0 *connect.Response[workflow.CreateRunResponse], _a1 error) *RunServiceClient_CreateRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_CreateRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error)) *RunServiceClient_CreateRun_Call { + _c.Call.Return(run) + return _c +} + +// GetActionData provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) GetActionData(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetActionData") + } + + var r0 *connect.Response[workflow.GetActionDataResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) *connect.Response[workflow.GetActionDataResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetActionDataResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_GetActionData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActionData' +type RunServiceClient_GetActionData_Call struct { + *mock.Call +} + +// GetActionData is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetActionDataRequest] +func (_e *RunServiceClient_Expecter) GetActionData(_a0 interface{}, _a1 interface{}) *RunServiceClient_GetActionData_Call { + return &RunServiceClient_GetActionData_Call{Call: _e.mock.On("GetActionData", _a0, _a1)} +} + +func (_c *RunServiceClient_GetActionData_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDataRequest])) *RunServiceClient_GetActionData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetActionDataRequest])) + }) + return _c +} + +func (_c *RunServiceClient_GetActionData_Call) Return(_a0 *connect.Response[workflow.GetActionDataResponse], _a1 error) *RunServiceClient_GetActionData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_GetActionData_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error)) *RunServiceClient_GetActionData_Call { + _c.Call.Return(run) + return _c +} + +// GetActionDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) GetActionDetails(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetActionDetails") + } + + var r0 *connect.Response[workflow.GetActionDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) *connect.Response[workflow.GetActionDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetActionDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_GetActionDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActionDetails' +type RunServiceClient_GetActionDetails_Call struct { + *mock.Call +} + +// GetActionDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetActionDetailsRequest] +func (_e *RunServiceClient_Expecter) GetActionDetails(_a0 interface{}, _a1 interface{}) *RunServiceClient_GetActionDetails_Call { + return &RunServiceClient_GetActionDetails_Call{Call: _e.mock.On("GetActionDetails", _a0, _a1)} +} + +func (_c *RunServiceClient_GetActionDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDetailsRequest])) *RunServiceClient_GetActionDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetActionDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_GetActionDetails_Call) Return(_a0 *connect.Response[workflow.GetActionDetailsResponse], _a1 error) *RunServiceClient_GetActionDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_GetActionDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error)) *RunServiceClient_GetActionDetails_Call { + _c.Call.Return(run) + return _c +} + +// GetRunDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) GetRunDetails(_a0 context.Context, _a1 *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetRunDetails") + } + + var r0 *connect.Response[workflow.GetRunDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) *connect.Response[workflow.GetRunDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetRunDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_GetRunDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRunDetails' +type RunServiceClient_GetRunDetails_Call struct { + *mock.Call +} + +// GetRunDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetRunDetailsRequest] +func (_e *RunServiceClient_Expecter) GetRunDetails(_a0 interface{}, _a1 interface{}) *RunServiceClient_GetRunDetails_Call { + return &RunServiceClient_GetRunDetails_Call{Call: _e.mock.On("GetRunDetails", _a0, _a1)} +} + +func (_c *RunServiceClient_GetRunDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetRunDetailsRequest])) *RunServiceClient_GetRunDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetRunDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_GetRunDetails_Call) Return(_a0 *connect.Response[workflow.GetRunDetailsResponse], _a1 error) *RunServiceClient_GetRunDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_GetRunDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error)) *RunServiceClient_GetRunDetails_Call { + _c.Call.Return(run) + return _c +} + +// ListActions provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) ListActions(_a0 context.Context, _a1 *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for ListActions") + } + + var r0 *connect.Response[workflow.ListActionsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) *connect.Response[workflow.ListActionsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.ListActionsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_ListActions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListActions' +type RunServiceClient_ListActions_Call struct { + *mock.Call +} + +// ListActions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.ListActionsRequest] +func (_e *RunServiceClient_Expecter) ListActions(_a0 interface{}, _a1 interface{}) *RunServiceClient_ListActions_Call { + return &RunServiceClient_ListActions_Call{Call: _e.mock.On("ListActions", _a0, _a1)} +} + +func (_c *RunServiceClient_ListActions_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.ListActionsRequest])) *RunServiceClient_ListActions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.ListActionsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_ListActions_Call) Return(_a0 *connect.Response[workflow.ListActionsResponse], _a1 error) *RunServiceClient_ListActions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_ListActions_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error)) *RunServiceClient_ListActions_Call { + _c.Call.Return(run) + return _c +} + +// ListRuns provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) ListRuns(_a0 context.Context, _a1 *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for ListRuns") + } + + var r0 *connect.Response[workflow.ListRunsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) *connect.Response[workflow.ListRunsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.ListRunsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_ListRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRuns' +type RunServiceClient_ListRuns_Call struct { + *mock.Call +} + +// ListRuns is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.ListRunsRequest] +func (_e *RunServiceClient_Expecter) ListRuns(_a0 interface{}, _a1 interface{}) *RunServiceClient_ListRuns_Call { + return &RunServiceClient_ListRuns_Call{Call: _e.mock.On("ListRuns", _a0, _a1)} +} + +func (_c *RunServiceClient_ListRuns_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.ListRunsRequest])) *RunServiceClient_ListRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.ListRunsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_ListRuns_Call) Return(_a0 *connect.Response[workflow.ListRunsResponse], _a1 error) *RunServiceClient_ListRuns_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_ListRuns_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error)) *RunServiceClient_ListRuns_Call { + _c.Call.Return(run) + return _c +} + +// WatchActionDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchActionDetails(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchActionDetails") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchActionDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest]) *connect.ServerStreamForClient[workflow.WatchActionDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchActionDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchActionDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchActionDetails' +type RunServiceClient_WatchActionDetails_Call struct { + *mock.Call +} + +// WatchActionDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchActionDetailsRequest] +func (_e *RunServiceClient_Expecter) WatchActionDetails(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchActionDetails_Call { + return &RunServiceClient_WatchActionDetails_Call{Call: _e.mock.On("WatchActionDetails", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchActionDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionDetailsRequest])) *RunServiceClient_WatchActionDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchActionDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchActionDetails_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchActionDetailsResponse], _a1 error) *RunServiceClient_WatchActionDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchActionDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionDetailsResponse], error)) *RunServiceClient_WatchActionDetails_Call { + _c.Call.Return(run) + return _c +} + +// WatchActions provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchActions(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchActions") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchActionsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionsRequest]) *connect.ServerStreamForClient[workflow.WatchActionsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchActionsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchActionsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchActions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchActions' +type RunServiceClient_WatchActions_Call struct { + *mock.Call +} + +// WatchActions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchActionsRequest] +func (_e *RunServiceClient_Expecter) WatchActions(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchActions_Call { + return &RunServiceClient_WatchActions_Call{Call: _e.mock.On("WatchActions", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchActions_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionsRequest])) *RunServiceClient_WatchActions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchActionsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchActions_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchActionsResponse], _a1 error) *RunServiceClient_WatchActions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchActions_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchActionsRequest]) (*connect.ServerStreamForClient[workflow.WatchActionsResponse], error)) *RunServiceClient_WatchActions_Call { + _c.Call.Return(run) + return _c +} + +// WatchClusterEvents provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchClusterEvents(_a0 context.Context, _a1 *connect.Request[workflow.WatchClusterEventsRequest]) (*connect.ServerStreamForClient[workflow.WatchClusterEventsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchClusterEvents") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchClusterEventsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest]) (*connect.ServerStreamForClient[workflow.WatchClusterEventsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest]) *connect.ServerStreamForClient[workflow.WatchClusterEventsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchClusterEventsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchClusterEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchClusterEvents' +type RunServiceClient_WatchClusterEvents_Call struct { + *mock.Call +} + +// WatchClusterEvents is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchClusterEventsRequest] +func (_e *RunServiceClient_Expecter) WatchClusterEvents(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchClusterEvents_Call { + return &RunServiceClient_WatchClusterEvents_Call{Call: _e.mock.On("WatchClusterEvents", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchClusterEvents_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchClusterEventsRequest])) *RunServiceClient_WatchClusterEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchClusterEventsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchClusterEvents_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchClusterEventsResponse], _a1 error) *RunServiceClient_WatchClusterEvents_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchClusterEvents_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest]) (*connect.ServerStreamForClient[workflow.WatchClusterEventsResponse], error)) *RunServiceClient_WatchClusterEvents_Call { + _c.Call.Return(run) + return _c +} + +// WatchGroups provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchGroups(_a0 context.Context, _a1 *connect.Request[workflow.WatchGroupsRequest]) (*connect.ServerStreamForClient[workflow.WatchGroupsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchGroups") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchGroupsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchGroupsRequest]) (*connect.ServerStreamForClient[workflow.WatchGroupsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchGroupsRequest]) *connect.ServerStreamForClient[workflow.WatchGroupsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchGroupsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchGroupsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchGroups' +type RunServiceClient_WatchGroups_Call struct { + *mock.Call +} + +// WatchGroups is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchGroupsRequest] +func (_e *RunServiceClient_Expecter) WatchGroups(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchGroups_Call { + return &RunServiceClient_WatchGroups_Call{Call: _e.mock.On("WatchGroups", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchGroups_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchGroupsRequest])) *RunServiceClient_WatchGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchGroupsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchGroups_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchGroupsResponse], _a1 error) *RunServiceClient_WatchGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchGroups_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchGroupsRequest]) (*connect.ServerStreamForClient[workflow.WatchGroupsResponse], error)) *RunServiceClient_WatchGroups_Call { + _c.Call.Return(run) + return _c +} + +// WatchRunDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchRunDetails(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchRunDetails") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchRunDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest]) *connect.ServerStreamForClient[workflow.WatchRunDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchRunDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchRunDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRunDetails' +type RunServiceClient_WatchRunDetails_Call struct { + *mock.Call +} + +// WatchRunDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRunDetailsRequest] +func (_e *RunServiceClient_Expecter) WatchRunDetails(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchRunDetails_Call { + return &RunServiceClient_WatchRunDetails_Call{Call: _e.mock.On("WatchRunDetails", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchRunDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunDetailsRequest])) *RunServiceClient_WatchRunDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRunDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchRunDetails_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchRunDetailsResponse], _a1 error) *RunServiceClient_WatchRunDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchRunDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunDetailsResponse], error)) *RunServiceClient_WatchRunDetails_Call { + _c.Call.Return(run) + return _c +} + +// WatchRuns provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceClient) WatchRuns(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for WatchRuns") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchRunsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunsRequest]) *connect.ServerStreamForClient[workflow.WatchRunsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchRunsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchRunsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceClient_WatchRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRuns' +type RunServiceClient_WatchRuns_Call struct { + *mock.Call +} + +// WatchRuns is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRunsRequest] +func (_e *RunServiceClient_Expecter) WatchRuns(_a0 interface{}, _a1 interface{}) *RunServiceClient_WatchRuns_Call { + return &RunServiceClient_WatchRuns_Call{Call: _e.mock.On("WatchRuns", _a0, _a1)} +} + +func (_c *RunServiceClient_WatchRuns_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunsRequest])) *RunServiceClient_WatchRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRunsRequest])) + }) + return _c +} + +func (_c *RunServiceClient_WatchRuns_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchRunsResponse], _a1 error) *RunServiceClient_WatchRuns_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceClient_WatchRuns_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRunsRequest]) (*connect.ServerStreamForClient[workflow.WatchRunsResponse], error)) *RunServiceClient_WatchRuns_Call { + _c.Call.Return(run) + return _c +} + +// NewRunServiceClient creates a new instance of RunServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRunServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *RunServiceClient { + mock := &RunServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceHandler.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceHandler.go new file mode 100644 index 0000000000..cb477de244 --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_RunServiceHandler.go @@ -0,0 +1,800 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// RunServiceHandler is an autogenerated mock type for the RunServiceHandler type +type RunServiceHandler struct { + mock.Mock +} + +type RunServiceHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *RunServiceHandler) EXPECT() *RunServiceHandler_Expecter { + return &RunServiceHandler_Expecter{mock: &_m.Mock} +} + +// AbortAction provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) AbortAction(_a0 context.Context, _a1 *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortAction") + } + + var r0 *connect.Response[workflow.AbortActionResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) *connect.Response[workflow.AbortActionResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortActionResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortActionRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_AbortAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortAction' +type RunServiceHandler_AbortAction_Call struct { + *mock.Call +} + +// AbortAction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortActionRequest] +func (_e *RunServiceHandler_Expecter) AbortAction(_a0 interface{}, _a1 interface{}) *RunServiceHandler_AbortAction_Call { + return &RunServiceHandler_AbortAction_Call{Call: _e.mock.On("AbortAction", _a0, _a1)} +} + +func (_c *RunServiceHandler_AbortAction_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortActionRequest])) *RunServiceHandler_AbortAction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortActionRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_AbortAction_Call) Return(_a0 *connect.Response[workflow.AbortActionResponse], _a1 error) *RunServiceHandler_AbortAction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_AbortAction_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortActionRequest]) (*connect.Response[workflow.AbortActionResponse], error)) *RunServiceHandler_AbortAction_Call { + _c.Call.Return(run) + return _c +} + +// AbortRun provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) AbortRun(_a0 context.Context, _a1 *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbortRun") + } + + var r0 *connect.Response[workflow.AbortRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) *connect.Response[workflow.AbortRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.AbortRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.AbortRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_AbortRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortRun' +type RunServiceHandler_AbortRun_Call struct { + *mock.Call +} + +// AbortRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.AbortRunRequest] +func (_e *RunServiceHandler_Expecter) AbortRun(_a0 interface{}, _a1 interface{}) *RunServiceHandler_AbortRun_Call { + return &RunServiceHandler_AbortRun_Call{Call: _e.mock.On("AbortRun", _a0, _a1)} +} + +func (_c *RunServiceHandler_AbortRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.AbortRunRequest])) *RunServiceHandler_AbortRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.AbortRunRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_AbortRun_Call) Return(_a0 *connect.Response[workflow.AbortRunResponse], _a1 error) *RunServiceHandler_AbortRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_AbortRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.AbortRunRequest]) (*connect.Response[workflow.AbortRunResponse], error)) *RunServiceHandler_AbortRun_Call { + _c.Call.Return(run) + return _c +} + +// CreateRun provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) CreateRun(_a0 context.Context, _a1 *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for CreateRun") + } + + var r0 *connect.Response[workflow.CreateRunResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) *connect.Response[workflow.CreateRunResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.CreateRunResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.CreateRunRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_CreateRun_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRun' +type RunServiceHandler_CreateRun_Call struct { + *mock.Call +} + +// CreateRun is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.CreateRunRequest] +func (_e *RunServiceHandler_Expecter) CreateRun(_a0 interface{}, _a1 interface{}) *RunServiceHandler_CreateRun_Call { + return &RunServiceHandler_CreateRun_Call{Call: _e.mock.On("CreateRun", _a0, _a1)} +} + +func (_c *RunServiceHandler_CreateRun_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.CreateRunRequest])) *RunServiceHandler_CreateRun_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.CreateRunRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_CreateRun_Call) Return(_a0 *connect.Response[workflow.CreateRunResponse], _a1 error) *RunServiceHandler_CreateRun_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_CreateRun_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.CreateRunRequest]) (*connect.Response[workflow.CreateRunResponse], error)) *RunServiceHandler_CreateRun_Call { + _c.Call.Return(run) + return _c +} + +// GetActionData provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) GetActionData(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetActionData") + } + + var r0 *connect.Response[workflow.GetActionDataResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) *connect.Response[workflow.GetActionDataResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetActionDataResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetActionDataRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_GetActionData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActionData' +type RunServiceHandler_GetActionData_Call struct { + *mock.Call +} + +// GetActionData is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetActionDataRequest] +func (_e *RunServiceHandler_Expecter) GetActionData(_a0 interface{}, _a1 interface{}) *RunServiceHandler_GetActionData_Call { + return &RunServiceHandler_GetActionData_Call{Call: _e.mock.On("GetActionData", _a0, _a1)} +} + +func (_c *RunServiceHandler_GetActionData_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDataRequest])) *RunServiceHandler_GetActionData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetActionDataRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_GetActionData_Call) Return(_a0 *connect.Response[workflow.GetActionDataResponse], _a1 error) *RunServiceHandler_GetActionData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_GetActionData_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetActionDataRequest]) (*connect.Response[workflow.GetActionDataResponse], error)) *RunServiceHandler_GetActionData_Call { + _c.Call.Return(run) + return _c +} + +// GetActionDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) GetActionDetails(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetActionDetails") + } + + var r0 *connect.Response[workflow.GetActionDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) *connect.Response[workflow.GetActionDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetActionDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_GetActionDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActionDetails' +type RunServiceHandler_GetActionDetails_Call struct { + *mock.Call +} + +// GetActionDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetActionDetailsRequest] +func (_e *RunServiceHandler_Expecter) GetActionDetails(_a0 interface{}, _a1 interface{}) *RunServiceHandler_GetActionDetails_Call { + return &RunServiceHandler_GetActionDetails_Call{Call: _e.mock.On("GetActionDetails", _a0, _a1)} +} + +func (_c *RunServiceHandler_GetActionDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetActionDetailsRequest])) *RunServiceHandler_GetActionDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetActionDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_GetActionDetails_Call) Return(_a0 *connect.Response[workflow.GetActionDetailsResponse], _a1 error) *RunServiceHandler_GetActionDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_GetActionDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetActionDetailsRequest]) (*connect.Response[workflow.GetActionDetailsResponse], error)) *RunServiceHandler_GetActionDetails_Call { + _c.Call.Return(run) + return _c +} + +// GetRunDetails provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) GetRunDetails(_a0 context.Context, _a1 *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetRunDetails") + } + + var r0 *connect.Response[workflow.GetRunDetailsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) *connect.Response[workflow.GetRunDetailsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetRunDetailsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_GetRunDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRunDetails' +type RunServiceHandler_GetRunDetails_Call struct { + *mock.Call +} + +// GetRunDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetRunDetailsRequest] +func (_e *RunServiceHandler_Expecter) GetRunDetails(_a0 interface{}, _a1 interface{}) *RunServiceHandler_GetRunDetails_Call { + return &RunServiceHandler_GetRunDetails_Call{Call: _e.mock.On("GetRunDetails", _a0, _a1)} +} + +func (_c *RunServiceHandler_GetRunDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetRunDetailsRequest])) *RunServiceHandler_GetRunDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetRunDetailsRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_GetRunDetails_Call) Return(_a0 *connect.Response[workflow.GetRunDetailsResponse], _a1 error) *RunServiceHandler_GetRunDetails_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_GetRunDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetRunDetailsRequest]) (*connect.Response[workflow.GetRunDetailsResponse], error)) *RunServiceHandler_GetRunDetails_Call { + _c.Call.Return(run) + return _c +} + +// ListActions provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) ListActions(_a0 context.Context, _a1 *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for ListActions") + } + + var r0 *connect.Response[workflow.ListActionsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) *connect.Response[workflow.ListActionsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.ListActionsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.ListActionsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_ListActions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListActions' +type RunServiceHandler_ListActions_Call struct { + *mock.Call +} + +// ListActions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.ListActionsRequest] +func (_e *RunServiceHandler_Expecter) ListActions(_a0 interface{}, _a1 interface{}) *RunServiceHandler_ListActions_Call { + return &RunServiceHandler_ListActions_Call{Call: _e.mock.On("ListActions", _a0, _a1)} +} + +func (_c *RunServiceHandler_ListActions_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.ListActionsRequest])) *RunServiceHandler_ListActions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.ListActionsRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_ListActions_Call) Return(_a0 *connect.Response[workflow.ListActionsResponse], _a1 error) *RunServiceHandler_ListActions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_ListActions_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.ListActionsRequest]) (*connect.Response[workflow.ListActionsResponse], error)) *RunServiceHandler_ListActions_Call { + _c.Call.Return(run) + return _c +} + +// ListRuns provides a mock function with given fields: _a0, _a1 +func (_m *RunServiceHandler) ListRuns(_a0 context.Context, _a1 *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for ListRuns") + } + + var r0 *connect.Response[workflow.ListRunsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) *connect.Response[workflow.ListRunsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.ListRunsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.ListRunsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RunServiceHandler_ListRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRuns' +type RunServiceHandler_ListRuns_Call struct { + *mock.Call +} + +// ListRuns is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.ListRunsRequest] +func (_e *RunServiceHandler_Expecter) ListRuns(_a0 interface{}, _a1 interface{}) *RunServiceHandler_ListRuns_Call { + return &RunServiceHandler_ListRuns_Call{Call: _e.mock.On("ListRuns", _a0, _a1)} +} + +func (_c *RunServiceHandler_ListRuns_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.ListRunsRequest])) *RunServiceHandler_ListRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.ListRunsRequest])) + }) + return _c +} + +func (_c *RunServiceHandler_ListRuns_Call) Return(_a0 *connect.Response[workflow.ListRunsResponse], _a1 error) *RunServiceHandler_ListRuns_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RunServiceHandler_ListRuns_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.ListRunsRequest]) (*connect.Response[workflow.ListRunsResponse], error)) *RunServiceHandler_ListRuns_Call { + _c.Call.Return(run) + return _c +} + +// WatchActionDetails provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchActionDetails(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionDetailsRequest], _a2 *connect.ServerStream[workflow.WatchActionDetailsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchActionDetails") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest], *connect.ServerStream[workflow.WatchActionDetailsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchActionDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchActionDetails' +type RunServiceHandler_WatchActionDetails_Call struct { + *mock.Call +} + +// WatchActionDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchActionDetailsRequest] +// - _a2 *connect.ServerStream[workflow.WatchActionDetailsResponse] +func (_e *RunServiceHandler_Expecter) WatchActionDetails(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchActionDetails_Call { + return &RunServiceHandler_WatchActionDetails_Call{Call: _e.mock.On("WatchActionDetails", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchActionDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionDetailsRequest], _a2 *connect.ServerStream[workflow.WatchActionDetailsResponse])) *RunServiceHandler_WatchActionDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchActionDetailsRequest]), args[2].(*connect.ServerStream[workflow.WatchActionDetailsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchActionDetails_Call) Return(_a0 error) *RunServiceHandler_WatchActionDetails_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchActionDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchActionDetailsRequest], *connect.ServerStream[workflow.WatchActionDetailsResponse]) error) *RunServiceHandler_WatchActionDetails_Call { + _c.Call.Return(run) + return _c +} + +// WatchActions provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchActions(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionsRequest], _a2 *connect.ServerStream[workflow.WatchActionsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchActions") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchActionsRequest], *connect.ServerStream[workflow.WatchActionsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchActions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchActions' +type RunServiceHandler_WatchActions_Call struct { + *mock.Call +} + +// WatchActions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchActionsRequest] +// - _a2 *connect.ServerStream[workflow.WatchActionsResponse] +func (_e *RunServiceHandler_Expecter) WatchActions(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchActions_Call { + return &RunServiceHandler_WatchActions_Call{Call: _e.mock.On("WatchActions", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchActions_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchActionsRequest], _a2 *connect.ServerStream[workflow.WatchActionsResponse])) *RunServiceHandler_WatchActions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchActionsRequest]), args[2].(*connect.ServerStream[workflow.WatchActionsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchActions_Call) Return(_a0 error) *RunServiceHandler_WatchActions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchActions_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchActionsRequest], *connect.ServerStream[workflow.WatchActionsResponse]) error) *RunServiceHandler_WatchActions_Call { + _c.Call.Return(run) + return _c +} + +// WatchClusterEvents provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchClusterEvents(_a0 context.Context, _a1 *connect.Request[workflow.WatchClusterEventsRequest], _a2 *connect.ServerStream[workflow.WatchClusterEventsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchClusterEvents") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest], *connect.ServerStream[workflow.WatchClusterEventsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchClusterEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchClusterEvents' +type RunServiceHandler_WatchClusterEvents_Call struct { + *mock.Call +} + +// WatchClusterEvents is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchClusterEventsRequest] +// - _a2 *connect.ServerStream[workflow.WatchClusterEventsResponse] +func (_e *RunServiceHandler_Expecter) WatchClusterEvents(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchClusterEvents_Call { + return &RunServiceHandler_WatchClusterEvents_Call{Call: _e.mock.On("WatchClusterEvents", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchClusterEvents_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchClusterEventsRequest], _a2 *connect.ServerStream[workflow.WatchClusterEventsResponse])) *RunServiceHandler_WatchClusterEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchClusterEventsRequest]), args[2].(*connect.ServerStream[workflow.WatchClusterEventsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchClusterEvents_Call) Return(_a0 error) *RunServiceHandler_WatchClusterEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchClusterEvents_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchClusterEventsRequest], *connect.ServerStream[workflow.WatchClusterEventsResponse]) error) *RunServiceHandler_WatchClusterEvents_Call { + _c.Call.Return(run) + return _c +} + +// WatchGroups provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchGroups(_a0 context.Context, _a1 *connect.Request[workflow.WatchGroupsRequest], _a2 *connect.ServerStream[workflow.WatchGroupsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchGroups") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchGroupsRequest], *connect.ServerStream[workflow.WatchGroupsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchGroups' +type RunServiceHandler_WatchGroups_Call struct { + *mock.Call +} + +// WatchGroups is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchGroupsRequest] +// - _a2 *connect.ServerStream[workflow.WatchGroupsResponse] +func (_e *RunServiceHandler_Expecter) WatchGroups(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchGroups_Call { + return &RunServiceHandler_WatchGroups_Call{Call: _e.mock.On("WatchGroups", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchGroups_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchGroupsRequest], _a2 *connect.ServerStream[workflow.WatchGroupsResponse])) *RunServiceHandler_WatchGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchGroupsRequest]), args[2].(*connect.ServerStream[workflow.WatchGroupsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchGroups_Call) Return(_a0 error) *RunServiceHandler_WatchGroups_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchGroups_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchGroupsRequest], *connect.ServerStream[workflow.WatchGroupsResponse]) error) *RunServiceHandler_WatchGroups_Call { + _c.Call.Return(run) + return _c +} + +// WatchRunDetails provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchRunDetails(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunDetailsRequest], _a2 *connect.ServerStream[workflow.WatchRunDetailsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchRunDetails") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest], *connect.ServerStream[workflow.WatchRunDetailsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchRunDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRunDetails' +type RunServiceHandler_WatchRunDetails_Call struct { + *mock.Call +} + +// WatchRunDetails is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRunDetailsRequest] +// - _a2 *connect.ServerStream[workflow.WatchRunDetailsResponse] +func (_e *RunServiceHandler_Expecter) WatchRunDetails(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchRunDetails_Call { + return &RunServiceHandler_WatchRunDetails_Call{Call: _e.mock.On("WatchRunDetails", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchRunDetails_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunDetailsRequest], _a2 *connect.ServerStream[workflow.WatchRunDetailsResponse])) *RunServiceHandler_WatchRunDetails_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRunDetailsRequest]), args[2].(*connect.ServerStream[workflow.WatchRunDetailsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchRunDetails_Call) Return(_a0 error) *RunServiceHandler_WatchRunDetails_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchRunDetails_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRunDetailsRequest], *connect.ServerStream[workflow.WatchRunDetailsResponse]) error) *RunServiceHandler_WatchRunDetails_Call { + _c.Call.Return(run) + return _c +} + +// WatchRuns provides a mock function with given fields: _a0, _a1, _a2 +func (_m *RunServiceHandler) WatchRuns(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunsRequest], _a2 *connect.ServerStream[workflow.WatchRunsResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for WatchRuns") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRunsRequest], *connect.ServerStream[workflow.WatchRunsResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RunServiceHandler_WatchRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WatchRuns' +type RunServiceHandler_WatchRuns_Call struct { + *mock.Call +} + +// WatchRuns is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRunsRequest] +// - _a2 *connect.ServerStream[workflow.WatchRunsResponse] +func (_e *RunServiceHandler_Expecter) WatchRuns(_a0 interface{}, _a1 interface{}, _a2 interface{}) *RunServiceHandler_WatchRuns_Call { + return &RunServiceHandler_WatchRuns_Call{Call: _e.mock.On("WatchRuns", _a0, _a1, _a2)} +} + +func (_c *RunServiceHandler_WatchRuns_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRunsRequest], _a2 *connect.ServerStream[workflow.WatchRunsResponse])) *RunServiceHandler_WatchRuns_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRunsRequest]), args[2].(*connect.ServerStream[workflow.WatchRunsResponse])) + }) + return _c +} + +func (_c *RunServiceHandler_WatchRuns_Call) Return(_a0 error) *RunServiceHandler_WatchRuns_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RunServiceHandler_WatchRuns_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRunsRequest], *connect.ServerStream[workflow.WatchRunsResponse]) error) *RunServiceHandler_WatchRuns_Call { + _c.Call.Return(run) + return _c +} + +// NewRunServiceHandler creates a new instance of RunServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRunServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *RunServiceHandler { + mock := &RunServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceClient.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceClient.go new file mode 100644 index 0000000000..62e82b9e0d --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceClient.go @@ -0,0 +1,217 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// StateServiceClient is an autogenerated mock type for the StateServiceClient type +type StateServiceClient struct { + mock.Mock +} + +type StateServiceClient_Expecter struct { + mock *mock.Mock +} + +func (_m *StateServiceClient) EXPECT() *StateServiceClient_Expecter { + return &StateServiceClient_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: _a0, _a1 +func (_m *StateServiceClient) Get(_a0 context.Context, _a1 *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *connect.Response[workflow.GetResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRequest]) *connect.Response[workflow.GetResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// StateServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type StateServiceClient_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetRequest] +func (_e *StateServiceClient_Expecter) Get(_a0 interface{}, _a1 interface{}) *StateServiceClient_Get_Call { + return &StateServiceClient_Get_Call{Call: _e.mock.On("Get", _a0, _a1)} +} + +func (_c *StateServiceClient_Get_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetRequest])) *StateServiceClient_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetRequest])) + }) + return _c +} + +func (_c *StateServiceClient_Get_Call) Return(_a0 *connect.Response[workflow.GetResponse], _a1 error) *StateServiceClient_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateServiceClient_Get_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error)) *StateServiceClient_Get_Call { + _c.Call.Return(run) + return _c +} + +// Put provides a mock function with given fields: _a0, _a1 +func (_m *StateServiceClient) Put(_a0 context.Context, _a1 *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Put") + } + + var r0 *connect.Response[workflow.PutResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.PutRequest]) *connect.Response[workflow.PutResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.PutResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.PutRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// StateServiceClient_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type StateServiceClient_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.PutRequest] +func (_e *StateServiceClient_Expecter) Put(_a0 interface{}, _a1 interface{}) *StateServiceClient_Put_Call { + return &StateServiceClient_Put_Call{Call: _e.mock.On("Put", _a0, _a1)} +} + +func (_c *StateServiceClient_Put_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.PutRequest])) *StateServiceClient_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.PutRequest])) + }) + return _c +} + +func (_c *StateServiceClient_Put_Call) Return(_a0 *connect.Response[workflow.PutResponse], _a1 error) *StateServiceClient_Put_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateServiceClient_Put_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error)) *StateServiceClient_Put_Call { + _c.Call.Return(run) + return _c +} + +// Watch provides a mock function with given fields: _a0, _a1 +func (_m *StateServiceClient) Watch(_a0 context.Context, _a1 *connect.Request[workflow.WatchRequest]) (*connect.ServerStreamForClient[workflow.WatchResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Watch") + } + + var r0 *connect.ServerStreamForClient[workflow.WatchResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRequest]) (*connect.ServerStreamForClient[workflow.WatchResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRequest]) *connect.ServerStreamForClient[workflow.WatchResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.ServerStreamForClient[workflow.WatchResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.WatchRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// StateServiceClient_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch' +type StateServiceClient_Watch_Call struct { + *mock.Call +} + +// Watch is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRequest] +func (_e *StateServiceClient_Expecter) Watch(_a0 interface{}, _a1 interface{}) *StateServiceClient_Watch_Call { + return &StateServiceClient_Watch_Call{Call: _e.mock.On("Watch", _a0, _a1)} +} + +func (_c *StateServiceClient_Watch_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRequest])) *StateServiceClient_Watch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRequest])) + }) + return _c +} + +func (_c *StateServiceClient_Watch_Call) Return(_a0 *connect.ServerStreamForClient[workflow.WatchResponse], _a1 error) *StateServiceClient_Watch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateServiceClient_Watch_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRequest]) (*connect.ServerStreamForClient[workflow.WatchResponse], error)) *StateServiceClient_Watch_Call { + _c.Call.Return(run) + return _c +} + +// NewStateServiceClient creates a new instance of StateServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStateServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *StateServiceClient { + mock := &StateServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceHandler.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceHandler.go new file mode 100644 index 0000000000..0ff238ba3e --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_StateServiceHandler.go @@ -0,0 +1,206 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// StateServiceHandler is an autogenerated mock type for the StateServiceHandler type +type StateServiceHandler struct { + mock.Mock +} + +type StateServiceHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *StateServiceHandler) EXPECT() *StateServiceHandler_Expecter { + return &StateServiceHandler_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function with given fields: _a0, _a1 +func (_m *StateServiceHandler) Get(_a0 context.Context, _a1 *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *connect.Response[workflow.GetResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.GetRequest]) *connect.Response[workflow.GetResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.GetResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.GetRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// StateServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type StateServiceHandler_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.GetRequest] +func (_e *StateServiceHandler_Expecter) Get(_a0 interface{}, _a1 interface{}) *StateServiceHandler_Get_Call { + return &StateServiceHandler_Get_Call{Call: _e.mock.On("Get", _a0, _a1)} +} + +func (_c *StateServiceHandler_Get_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.GetRequest])) *StateServiceHandler_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.GetRequest])) + }) + return _c +} + +func (_c *StateServiceHandler_Get_Call) Return(_a0 *connect.Response[workflow.GetResponse], _a1 error) *StateServiceHandler_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateServiceHandler_Get_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.GetRequest]) (*connect.Response[workflow.GetResponse], error)) *StateServiceHandler_Get_Call { + _c.Call.Return(run) + return _c +} + +// Put provides a mock function with given fields: _a0, _a1 +func (_m *StateServiceHandler) Put(_a0 context.Context, _a1 *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Put") + } + + var r0 *connect.Response[workflow.PutResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.PutRequest]) *connect.Response[workflow.PutResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.PutResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.PutRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// StateServiceHandler_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type StateServiceHandler_Put_Call struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.PutRequest] +func (_e *StateServiceHandler_Expecter) Put(_a0 interface{}, _a1 interface{}) *StateServiceHandler_Put_Call { + return &StateServiceHandler_Put_Call{Call: _e.mock.On("Put", _a0, _a1)} +} + +func (_c *StateServiceHandler_Put_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.PutRequest])) *StateServiceHandler_Put_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.PutRequest])) + }) + return _c +} + +func (_c *StateServiceHandler_Put_Call) Return(_a0 *connect.Response[workflow.PutResponse], _a1 error) *StateServiceHandler_Put_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateServiceHandler_Put_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.PutRequest]) (*connect.Response[workflow.PutResponse], error)) *StateServiceHandler_Put_Call { + _c.Call.Return(run) + return _c +} + +// Watch provides a mock function with given fields: _a0, _a1, _a2 +func (_m *StateServiceHandler) Watch(_a0 context.Context, _a1 *connect.Request[workflow.WatchRequest], _a2 *connect.ServerStream[workflow.WatchResponse]) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for Watch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.WatchRequest], *connect.ServerStream[workflow.WatchResponse]) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// StateServiceHandler_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch' +type StateServiceHandler_Watch_Call struct { + *mock.Call +} + +// Watch is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.WatchRequest] +// - _a2 *connect.ServerStream[workflow.WatchResponse] +func (_e *StateServiceHandler_Expecter) Watch(_a0 interface{}, _a1 interface{}, _a2 interface{}) *StateServiceHandler_Watch_Call { + return &StateServiceHandler_Watch_Call{Call: _e.mock.On("Watch", _a0, _a1, _a2)} +} + +func (_c *StateServiceHandler_Watch_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.WatchRequest], _a2 *connect.ServerStream[workflow.WatchResponse])) *StateServiceHandler_Watch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.WatchRequest]), args[2].(*connect.ServerStream[workflow.WatchResponse])) + }) + return _c +} + +func (_c *StateServiceHandler_Watch_Call) Return(_a0 error) *StateServiceHandler_Watch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *StateServiceHandler_Watch_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.WatchRequest], *connect.ServerStream[workflow.WatchResponse]) error) *StateServiceHandler_Watch_Call { + _c.Call.Return(run) + return _c +} + +// NewStateServiceHandler creates a new instance of StateServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStateServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *StateServiceHandler { + mock := &StateServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceClient.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceClient.go new file mode 100644 index 0000000000..811050438f --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceClient.go @@ -0,0 +1,217 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// TranslatorServiceClient is an autogenerated mock type for the TranslatorServiceClient type +type TranslatorServiceClient struct { + mock.Mock +} + +type TranslatorServiceClient_Expecter struct { + mock *mock.Mock +} + +func (_m *TranslatorServiceClient) EXPECT() *TranslatorServiceClient_Expecter { + return &TranslatorServiceClient_Expecter{mock: &_m.Mock} +} + +// LaunchFormJsonToLiterals provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceClient) LaunchFormJsonToLiterals(_a0 context.Context, _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for LaunchFormJsonToLiterals") + } + + var r0 *connect.Response[workflow.LaunchFormJsonToLiteralsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) *connect.Response[workflow.LaunchFormJsonToLiteralsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.LaunchFormJsonToLiteralsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceClient_LaunchFormJsonToLiterals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LaunchFormJsonToLiterals' +type TranslatorServiceClient_LaunchFormJsonToLiterals_Call struct { + *mock.Call +} + +// LaunchFormJsonToLiterals is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest] +func (_e *TranslatorServiceClient_Expecter) LaunchFormJsonToLiterals(_a0 interface{}, _a1 interface{}) *TranslatorServiceClient_LaunchFormJsonToLiterals_Call { + return &TranslatorServiceClient_LaunchFormJsonToLiterals_Call{Call: _e.mock.On("LaunchFormJsonToLiterals", _a0, _a1)} +} + +func (_c *TranslatorServiceClient_LaunchFormJsonToLiterals_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest])) *TranslatorServiceClient_LaunchFormJsonToLiterals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.LaunchFormJsonToLiteralsRequest])) + }) + return _c +} + +func (_c *TranslatorServiceClient_LaunchFormJsonToLiterals_Call) Return(_a0 *connect.Response[workflow.LaunchFormJsonToLiteralsResponse], _a1 error) *TranslatorServiceClient_LaunchFormJsonToLiterals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceClient_LaunchFormJsonToLiterals_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error)) *TranslatorServiceClient_LaunchFormJsonToLiterals_Call { + _c.Call.Return(run) + return _c +} + +// LiteralsToLaunchFormJson provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceClient) LiteralsToLaunchFormJson(_a0 context.Context, _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for LiteralsToLaunchFormJson") + } + + var r0 *connect.Response[workflow.LiteralsToLaunchFormJsonResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) *connect.Response[workflow.LiteralsToLaunchFormJsonResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.LiteralsToLaunchFormJsonResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceClient_LiteralsToLaunchFormJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LiteralsToLaunchFormJson' +type TranslatorServiceClient_LiteralsToLaunchFormJson_Call struct { + *mock.Call +} + +// LiteralsToLaunchFormJson is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest] +func (_e *TranslatorServiceClient_Expecter) LiteralsToLaunchFormJson(_a0 interface{}, _a1 interface{}) *TranslatorServiceClient_LiteralsToLaunchFormJson_Call { + return &TranslatorServiceClient_LiteralsToLaunchFormJson_Call{Call: _e.mock.On("LiteralsToLaunchFormJson", _a0, _a1)} +} + +func (_c *TranslatorServiceClient_LiteralsToLaunchFormJson_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest])) *TranslatorServiceClient_LiteralsToLaunchFormJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.LiteralsToLaunchFormJsonRequest])) + }) + return _c +} + +func (_c *TranslatorServiceClient_LiteralsToLaunchFormJson_Call) Return(_a0 *connect.Response[workflow.LiteralsToLaunchFormJsonResponse], _a1 error) *TranslatorServiceClient_LiteralsToLaunchFormJson_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceClient_LiteralsToLaunchFormJson_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error)) *TranslatorServiceClient_LiteralsToLaunchFormJson_Call { + _c.Call.Return(run) + return _c +} + +// TaskSpecToLaunchFormJson provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceClient) TaskSpecToLaunchFormJson(_a0 context.Context, _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for TaskSpecToLaunchFormJson") + } + + var r0 *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceClient_TaskSpecToLaunchFormJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskSpecToLaunchFormJson' +type TranslatorServiceClient_TaskSpecToLaunchFormJson_Call struct { + *mock.Call +} + +// TaskSpecToLaunchFormJson is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest] +func (_e *TranslatorServiceClient_Expecter) TaskSpecToLaunchFormJson(_a0 interface{}, _a1 interface{}) *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call { + return &TranslatorServiceClient_TaskSpecToLaunchFormJson_Call{Call: _e.mock.On("TaskSpecToLaunchFormJson", _a0, _a1)} +} + +func (_c *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest])) *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.TaskSpecToLaunchFormJsonRequest])) + }) + return _c +} + +func (_c *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call) Return(_a0 *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], _a1 error) *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error)) *TranslatorServiceClient_TaskSpecToLaunchFormJson_Call { + _c.Call.Return(run) + return _c +} + +// NewTranslatorServiceClient creates a new instance of TranslatorServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTranslatorServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *TranslatorServiceClient { + mock := &TranslatorServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceHandler.go b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceHandler.go new file mode 100644 index 0000000000..acabc4283f --- /dev/null +++ b/gen/go/flyteidl2/workflow/workflowconnect/mocks/mock_TranslatorServiceHandler.go @@ -0,0 +1,217 @@ +// Code generated by mockery. DO NOT EDIT. + +package workflowconnect + +import ( + context "context" + + connect "connectrpc.com/connect" + + mock "github.com/stretchr/testify/mock" + + workflow "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/workflow" +) + +// TranslatorServiceHandler is an autogenerated mock type for the TranslatorServiceHandler type +type TranslatorServiceHandler struct { + mock.Mock +} + +type TranslatorServiceHandler_Expecter struct { + mock *mock.Mock +} + +func (_m *TranslatorServiceHandler) EXPECT() *TranslatorServiceHandler_Expecter { + return &TranslatorServiceHandler_Expecter{mock: &_m.Mock} +} + +// LaunchFormJsonToLiterals provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceHandler) LaunchFormJsonToLiterals(_a0 context.Context, _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for LaunchFormJsonToLiterals") + } + + var r0 *connect.Response[workflow.LaunchFormJsonToLiteralsResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) *connect.Response[workflow.LaunchFormJsonToLiteralsResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.LaunchFormJsonToLiteralsResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceHandler_LaunchFormJsonToLiterals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LaunchFormJsonToLiterals' +type TranslatorServiceHandler_LaunchFormJsonToLiterals_Call struct { + *mock.Call +} + +// LaunchFormJsonToLiterals is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest] +func (_e *TranslatorServiceHandler_Expecter) LaunchFormJsonToLiterals(_a0 interface{}, _a1 interface{}) *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call { + return &TranslatorServiceHandler_LaunchFormJsonToLiterals_Call{Call: _e.mock.On("LaunchFormJsonToLiterals", _a0, _a1)} +} + +func (_c *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.LaunchFormJsonToLiteralsRequest])) *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.LaunchFormJsonToLiteralsRequest])) + }) + return _c +} + +func (_c *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call) Return(_a0 *connect.Response[workflow.LaunchFormJsonToLiteralsResponse], _a1 error) *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.LaunchFormJsonToLiteralsRequest]) (*connect.Response[workflow.LaunchFormJsonToLiteralsResponse], error)) *TranslatorServiceHandler_LaunchFormJsonToLiterals_Call { + _c.Call.Return(run) + return _c +} + +// LiteralsToLaunchFormJson provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceHandler) LiteralsToLaunchFormJson(_a0 context.Context, _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for LiteralsToLaunchFormJson") + } + + var r0 *connect.Response[workflow.LiteralsToLaunchFormJsonResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) *connect.Response[workflow.LiteralsToLaunchFormJsonResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.LiteralsToLaunchFormJsonResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceHandler_LiteralsToLaunchFormJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LiteralsToLaunchFormJson' +type TranslatorServiceHandler_LiteralsToLaunchFormJson_Call struct { + *mock.Call +} + +// LiteralsToLaunchFormJson is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest] +func (_e *TranslatorServiceHandler_Expecter) LiteralsToLaunchFormJson(_a0 interface{}, _a1 interface{}) *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call { + return &TranslatorServiceHandler_LiteralsToLaunchFormJson_Call{Call: _e.mock.On("LiteralsToLaunchFormJson", _a0, _a1)} +} + +func (_c *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.LiteralsToLaunchFormJsonRequest])) *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.LiteralsToLaunchFormJsonRequest])) + }) + return _c +} + +func (_c *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call) Return(_a0 *connect.Response[workflow.LiteralsToLaunchFormJsonResponse], _a1 error) *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.LiteralsToLaunchFormJsonRequest]) (*connect.Response[workflow.LiteralsToLaunchFormJsonResponse], error)) *TranslatorServiceHandler_LiteralsToLaunchFormJson_Call { + _c.Call.Return(run) + return _c +} + +// TaskSpecToLaunchFormJson provides a mock function with given fields: _a0, _a1 +func (_m *TranslatorServiceHandler) TaskSpecToLaunchFormJson(_a0 context.Context, _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for TaskSpecToLaunchFormJson") + } + + var r0 *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse] + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse]); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse]) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskSpecToLaunchFormJson' +type TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call struct { + *mock.Call +} + +// TaskSpecToLaunchFormJson is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest] +func (_e *TranslatorServiceHandler_Expecter) TaskSpecToLaunchFormJson(_a0 interface{}, _a1 interface{}) *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call { + return &TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call{Call: _e.mock.On("TaskSpecToLaunchFormJson", _a0, _a1)} +} + +func (_c *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call) Run(run func(_a0 context.Context, _a1 *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest])) *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*connect.Request[workflow.TaskSpecToLaunchFormJsonRequest])) + }) + return _c +} + +func (_c *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call) Return(_a0 *connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], _a1 error) *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call) RunAndReturn(run func(context.Context, *connect.Request[workflow.TaskSpecToLaunchFormJsonRequest]) (*connect.Response[workflow.TaskSpecToLaunchFormJsonResponse], error)) *TranslatorServiceHandler_TaskSpecToLaunchFormJson_Call { + _c.Call.Return(run) + return _c +} + +// NewTranslatorServiceHandler creates a new instance of TranslatorServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTranslatorServiceHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *TranslatorServiceHandler { + mock := &TranslatorServiceHandler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/gen/rust/Cargo.lock b/gen/rust/Cargo.lock index 830924724b..f69def2c93 100644 --- a/gen/rust/Cargo.lock +++ b/gen/rust/Cargo.lock @@ -135,9 +135,9 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.50" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f50d563227a1c37cc0a263f64eca3334388c01c5e4c4861a9def205c614383c" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ "find-msvc-tools", "shlex", @@ -188,9 +188,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" [[package]] name = "fixedbitset" @@ -542,9 +542,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "lazy_static" @@ -763,9 +763,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "portable-atomic" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59e70c4aef1e55797c2e8fd94a4f2a973fc972cfde0e0b05f683667b0cd39dd" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "ppv-lite86" @@ -788,9 +788,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" dependencies = [ "unicode-ident", ] @@ -1172,10 +1172,11 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.7" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] diff --git a/go.mod b/go.mod index 10c55cf96c..d55f65017c 100644 --- a/go.mod +++ b/go.mod @@ -89,7 +89,7 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/aws/aws-sdk-go-v2/credentials v1.16.12 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect @@ -223,6 +223,7 @@ replace ( github.com/flyteorg/flyte/v2 => ./ github.com/flyteorg/flyte/v2/flyteplugins => ./flyteplugins github.com/flyteorg/flyte/v2/flytestdlib => ./flytestdlib + github.com/google/cel-go => github.com/google/cel-go v0.16.1 github.com/google/gnostic-models => github.com/google/gnostic-models v0.6.8 github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20220915080349-5790c370e63a go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 diff --git a/go.sum b/go.sum index 905e8aa391..0b96e4c991 100644 --- a/go.sum +++ b/go.sum @@ -90,8 +90,8 @@ github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20200723154620-6f35a github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20200723154620-6f35a1152625/go.mod h1:6PnrZv6zUDkrNMw0mIoGRmGBR7i9LulhKPmxFq4rUiM= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= -github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ= @@ -262,8 +262,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI= -github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= +github.com/google/cel-go v0.16.1 h1:3hZfSNiAU3KOiNtxuFXVp5WFy4hf/Ly3Sa4/7F8SXNo= +github.com/google/cel-go v0.16.1/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= diff --git a/manager/cmd/main.go b/manager/cmd/main.go index 80c3144084..31446b794e 100644 --- a/manager/cmd/main.go +++ b/manager/cmd/main.go @@ -119,7 +119,7 @@ func serve(ctx context.Context) error { } // Create repository - repo := repository.NewPostgresRepository(db) + repo := repository.NewRepository(db) // Initialize Kubernetes client k8sClient, k8sConfig, err := initKubernetesClient(ctx, &cfg.Kubernetes)