feat: add restore statuses to kubernetes crd

This commit is contained in:
2024-12-08 00:47:53 +03:30
parent c5b19d3336
commit 5abc044d69
9 changed files with 101 additions and 39 deletions

View File

@@ -19,7 +19,7 @@ func (crd Crd) Patch(jobUid types.UID, patchData map[string]interface{}) error {
return fmt.Errorf("error marshaling patch data: %w", err)
}
// Patch the status subresource
// Patch the status sub-resource
unstructuredJob, err := crd.client.
Namespace(job.GetNamespace()).
Patch(
@@ -49,3 +49,14 @@ func (crd Crd) Patch(jobUid types.UID, patchData map[string]interface{}) error {
}
return nil
}
func (crd Crd) PatchAll(patchData map[string]interface{}) error {
keys := GetAllJobKeys()
for _, key := range keys {
err := crd.Patch(key, patchData)
if err != nil {
return err
}
}
return nil
}