mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-09 00:09:43 +00:00
manage status
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package kubernetes
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
func (c KubernetesClient) PatchStatus(ctx context.Context, obj client.Object) error {
|
||||
opts := &client.SubResourcePatchOptions{
|
||||
PatchOptions: client.PatchOptions{
|
||||
FieldManager: c.owner.Field,
|
||||
},
|
||||
}
|
||||
u, err := c.toUnstructured(obj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.client.Status().Patch(ctx, u, client.Apply, opts)
|
||||
}
|
||||
Reference in New Issue
Block a user