feat: add early update job def into patch
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
func (crd Crd) Patch(jobUid types.UID, patchData map[string]interface{}) error {
|
||||
func (crd *Crd) Patch(jobUid types.UID, patchData map[string]interface{}) error {
|
||||
job := GetJob(jobUid)
|
||||
|
||||
patchBytes, err := json.Marshal(patchData)
|
||||
@@ -37,12 +37,13 @@ func (crd Crd) Patch(jobUid types.UID, patchData map[string]interface{}) error {
|
||||
)
|
||||
return err
|
||||
}
|
||||
_, err = convertFromUnstructured(unstructuredJob)
|
||||
newJob, err := convertFromUnstructured(unstructuredJob)
|
||||
if err != nil {
|
||||
lc.Logger.Error("[crd] [status] error in structure unstructured patched", zap.Error(err))
|
||||
} else {
|
||||
lc.Logger.Debug("[crd] [status] patched")
|
||||
}
|
||||
jobs[jobUid] = newJob
|
||||
if err != nil {
|
||||
lc.Logger.Error("[crd] [status] ", zap.Error(err))
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user