feat: add early update job def into patch
This commit is contained in:
parent
0993ed4cb1
commit
bc20345fc0
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@ -1,10 +1,16 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"apiextensions",
|
||||
"clientcmd",
|
||||
"controllerutil",
|
||||
"deepcopy",
|
||||
"Finalizer",
|
||||
"flink",
|
||||
"gitea",
|
||||
"gonanoid",
|
||||
"logicamp",
|
||||
"Namespaceable",
|
||||
"reactivex",
|
||||
"repsert",
|
||||
"rxgo"
|
||||
]
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user