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:
@@ -15,6 +15,10 @@ type KubernetesClient interface {
|
||||
Delete(ctx context.Context, obj client.Object, opts DeleteOptions) error
|
||||
}
|
||||
|
||||
type StatusClient interface {
|
||||
PatchStatus(ctx context.Context, obj client.Object) error
|
||||
}
|
||||
|
||||
// DeleteOptions contains options for delete requests.
|
||||
type DeleteOptions struct {
|
||||
// DeletionPropagation decides how the garbage collector will handle the propagation.
|
||||
|
||||
@@ -14,9 +14,9 @@ type KubernetesHandler struct {
|
||||
objs []client.Object
|
||||
}
|
||||
|
||||
func NewKubernetesHandler(k KubernetesClient) *KubernetesHandler {
|
||||
func NewKubernetesHandler(c KubernetesClient) *KubernetesHandler {
|
||||
return &KubernetesHandler{
|
||||
client: k,
|
||||
client: c,
|
||||
objs: []client.Object{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
type StatusHandler struct {
|
||||
client StatusClient
|
||||
}
|
||||
|
||||
func NewStatusHandler(c StatusClient) *StatusHandler {
|
||||
return &StatusHandler{
|
||||
client: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *StatusHandler) Patch(ctx context.Context, obj client.Object) error {
|
||||
return s.client.PatchStatus(ctx, obj)
|
||||
}
|
||||
Reference in New Issue
Block a user