fix(invoke): заменить FunctionRef на поля из Function.Spec — FunctionJobSpec самодостаточен
This commit is contained in:
@@ -175,15 +175,22 @@ func (h *Handler) invokeFunctionJob(w http.ResponseWriter, r *http.Request, ns,
|
||||
jobName = jobName[:63]
|
||||
}
|
||||
|
||||
// Копируем поля из Function CRD — FunctionJob теперь самодостаточен (FunctionRef удалён).
|
||||
fj := &slessv1alpha1.FunctionJob{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: jobName,
|
||||
Namespace: ns,
|
||||
},
|
||||
Spec: slessv1alpha1.FunctionJobSpec{
|
||||
FunctionRef: name,
|
||||
EventJSON: eventJSON,
|
||||
RunID: time.Now().UnixNano(),
|
||||
Runtime: fn.Spec.Runtime,
|
||||
Entrypoint: fn.Spec.Entrypoint,
|
||||
S3Bucket: fn.Spec.S3Bucket,
|
||||
S3Key: fn.Spec.S3Key,
|
||||
MemoryMB: fn.Spec.MemoryMB,
|
||||
TimeoutSec: fn.Spec.TimeoutSec,
|
||||
Env: fn.Spec.Env,
|
||||
EventJSON: eventJSON,
|
||||
RunID: time.Now().UnixNano(),
|
||||
},
|
||||
}
|
||||
if err := h.K8s.Create(r.Context(), fj); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user